Browse Source

Merge pull request #4890 from heyitsanthony/fix-4889

clientv3/integration: get quorum before watching in TestKVCompact
Anthony Romano 9 years ago
parent
commit
1637b37132
1 changed files with 5 additions and 1 deletions
  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)
 		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()
 	defer wc.Close()
 	wchan := wc.Watch(ctx, "foo", clientv3.WithRev(3))
 	wchan := wc.Watch(ctx, "foo", clientv3.WithRev(3))