Ver Fonte

server: wait for entries to be committed in TestClusterConfigReload

Yicheng Qin há 11 anos atrás
pai
commit
b1426e2635
1 ficheiros alterados com 2 adições e 0 exclusões
  1. 2 0
      etcd/etcd_functional_test.go

+ 2 - 0
etcd/etcd_functional_test.go

@@ -173,6 +173,8 @@ func TestClusterConfigReload(t *testing.T) {
 		}
 
 		lead, _ = waitLeader(es)
+		// wait for msgAppResp to commit all entries
+		time.Sleep(2 * defaultHeartbeat * es[lead].tickDuration)
 		if g := es[lead].p.clusterConfig(); !reflect.DeepEqual(g, conf) {
 			t.Errorf("#%d: clusterConfig = %+v, want %+v", i, g, conf)
 		}