mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: get rid of unreliable WaitSchedule
In this case, we know we are waiting for an action happened on storage. We can do a busy wait instead of calling waitSchedule. The test previously failed on CI with no observed actions.
This commit is contained in:
parent
14210cf8a7
commit
3ec3ffbef0
@ -849,8 +849,15 @@ func TestRecvSnapshot(t *testing.T) {
|
||||
|
||||
s.start()
|
||||
n.readyc <- raft.Ready{Snapshot: raftpb.Snapshot{Metadata: raftpb.SnapshotMetadata{Index: 1}}}
|
||||
// make goroutines move forward to receive snapshot
|
||||
testutil.WaitSchedule()
|
||||
|
||||
// wait for actions happened on the storage
|
||||
for {
|
||||
if len(p.Action()) != 0 {
|
||||
break
|
||||
}
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
}
|
||||
|
||||
s.Stop()
|
||||
|
||||
wactions := []testutil.Action{{Name: "Recovery"}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user