etcdserver: refactor a for loop in recvSnap test

This commit is contained in:
Xiang Li 2015-12-02 15:16:20 -08:00
parent 67ffeee521
commit 0708a5e50d

View File

@ -851,10 +851,7 @@ func TestRecvSnapshot(t *testing.T) {
n.readyc <- raft.Ready{Snapshot: raftpb.Snapshot{Metadata: raftpb.SnapshotMetadata{Index: 1}}}
// wait for actions happened on the storage
for {
if len(p.Action()) != 0 {
break
}
for len(p.Action()) == 0 {
time.Sleep(10 * time.Millisecond)
}