فهرست منبع

server: fix 2nd watch timeout in TestSingleNodeRecovery

When recovering from data dir, the node needs election timeout to
elect itself to be the leader.
Yicheng Qin 11 سال پیش
والد
کامیت
2b0936271c
1فایلهای تغییر یافته به همراه1 افزوده شده و 0 حذف شده
  1. 1 0
      etcd/etcd_test.go

+ 1 - 0
etcd/etcd_test.go

@@ -351,6 +351,7 @@ func TestSingleNodeRecovery(t *testing.T) {
 	c.DataDir = dataDir
 	e, h, _ = buildServer(t, c, id)
 
+	waitLeader([]*Server{e})
 	w, err = e.p.Watch(key, false, false, ev.Index())
 	if err != nil {
 		t.Fatal(err)