Browse Source

etcdserver: refactor a for loop in recvSnap test

Xiang Li 10 years ago
parent
commit
0708a5e50d
1 changed files with 1 additions and 4 deletions
  1. 1 4
      etcdserver/server_test.go

+ 1 - 4
etcdserver/server_test.go

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