浏览代码

Merge pull request #3948 from xiang90/refactor

etcdserver: refactor a for loop in recvSnap test
Xiang Li 10 年之前
父节点
当前提交
4e5f20de3b
共有 1 个文件被更改,包括 1 次插入4 次删除
  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)
 	}