Merge pull request #3948 from xiang90/refactor

etcdserver: refactor a for loop in recvSnap test
This commit is contained in:
Xiang Li 2015-12-02 15:45:19 -08:00
commit 4e5f20de3b

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)
}