mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: fix TriggerSnap test.
Sleep for millisecond to allow the server to apply the first nop and first put separately.
This commit is contained in:
parent
62a8df304a
commit
4b7af29c37
@ -963,16 +963,19 @@ func TestTriggerSnap(t *testing.T) {
|
||||
}
|
||||
|
||||
srv.start()
|
||||
// wait for saving nop
|
||||
time.Sleep(time.Millisecond)
|
||||
for i := 0; uint64(i) < srv.snapCount-1; i++ {
|
||||
srv.Do(ctx, pb.Request{Method: "PUT", ID: 1})
|
||||
}
|
||||
// wait for saving the last entry
|
||||
time.Sleep(time.Millisecond)
|
||||
srv.Stop()
|
||||
|
||||
gaction := p.Action()
|
||||
// each operation is recorded as a Save
|
||||
// BootstrapConfig/Nop + (SnapCount - 1) * Puts + Cut + SaveSnap = Save + (SnapCount - 1) * Save + Cut + SaveSnap
|
||||
wcnt := 1 + int(srv.snapCount)
|
||||
wcnt := 2 + int(srv.snapCount)
|
||||
if len(gaction) != wcnt {
|
||||
t.Fatalf("len(action) = %d, want %d", len(gaction), wcnt)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user