Browse Source

clientv3/integration: get quorum before watching in TestKVCompact

Fixes #4889
Anthony Romano 9 năm trước cách đây
mục cha
commit
096abb3f37
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      clientv3/integration/kv_test.go

+ 5 - 1
clientv3/integration/kv_test.go

@@ -347,7 +347,11 @@ func TestKVCompact(t *testing.T) {
 		t.Fatalf("error got %v, want %v", err, rpctypes.ErrFutureRev)
 	}
 
-	wc := clientv3.NewWatcher(clus.RandClient())
+	wcli := clus.RandClient()
+	// new watcher could precede receiving the compaction without quorum first
+	wcli.Get(ctx, "quorum-get")
+
+	wc := clientv3.NewWatcher(wcli)
 	defer wc.Close()
 	wchan := wc.Watch(ctx, "foo", clientv3.WithRev(3))