update
This commit is contained in:
parent
6e5dbc5a47
commit
25a43f7a5e
@ -99,7 +99,7 @@ func (ts *Test) GenericTest() {
|
||||
// requests and had time to checkpoint.
|
||||
sz := ts.Config.Group(Gid).LogSize()
|
||||
if sz > 8*ts.maxraftstate {
|
||||
ts.Fatalf("logs were not trimmed (%v > 8*%v)", sz, ts.maxraftstate)
|
||||
ts.t.Fatalf("logs were not trimmed (%v > 8*%v)", sz, ts.maxraftstate)
|
||||
}
|
||||
}
|
||||
if ts.maxraftstate < 0 {
|
||||
|
@ -14,7 +14,7 @@ func TestBasic(t *testing.T) {
|
||||
for i := 0; i < 10; i++ {
|
||||
r := ts.one()
|
||||
if r.N != i+1 {
|
||||
ts.Fatalf("expected %d instead of %d", i, r.N)
|
||||
ts.t.Fatalf("expected %d instead of %d", i, r.N)
|
||||
}
|
||||
ts.checkCounter(r.N, NSRV)
|
||||
}
|
||||
|
@ -33,10 +33,10 @@ func TestStaticOneShardGroup5A(t *testing.T) {
|
||||
// Read the initial configuration and check it
|
||||
cfg, v, err := sck.Query()
|
||||
if err != rpc.OK {
|
||||
ts.Fatalf("Query failed %v", err)
|
||||
ts.t.Fatalf("Query failed %v", err)
|
||||
}
|
||||
if v != 1 || cfg.Num != 1 || cfg.Shards[0] != shardcfg.Gid1 {
|
||||
ts.Fatalf("Static wrong %v %v", cfg, v)
|
||||
ts.t.Fatalf("Static wrong %v %v", cfg, v)
|
||||
}
|
||||
cfg.CheckConfig(t, []tester.Tgid{shardcfg.Gid1})
|
||||
|
||||
|
@ -8,7 +8,8 @@ import (
|
||||
"math/big"
|
||||
"math/rand"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
// "runtime/debug"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
@ -137,8 +138,27 @@ func (cfg *Config) End() {
|
||||
}
|
||||
|
||||
func (cfg *Config) Fatalf(format string, args ...any) {
|
||||
debug.PrintStack()
|
||||
cfg.t.Fatalf(format, args...)
|
||||
const maxStackLen = 50
|
||||
fmt.Printf("Fatal: ")
|
||||
fmt.Printf(format, args...)
|
||||
fmt.Println("")
|
||||
var pc [maxStackLen]uintptr
|
||||
// Skip two extra frames to account for this function
|
||||
// and runtime.Callers itself.
|
||||
n := runtime.Callers(2, pc[:])
|
||||
if n == 0 {
|
||||
panic("testing: zero callers found")
|
||||
}
|
||||
frames := runtime.CallersFrames(pc[:n])
|
||||
var frame runtime.Frame
|
||||
for more := true; more; {
|
||||
frame, more = frames.Next()
|
||||
// Print only frames in our test files
|
||||
if strings.Contains(frame.File, "test.go") {
|
||||
fmt.Printf(" %v:%d\n", frame.File, frame.Line)
|
||||
}
|
||||
}
|
||||
cfg.t.FailNow()
|
||||
}
|
||||
|
||||
func Randstring(n int) string {
|
||||
|
Loading…
x
Reference in New Issue
Block a user