Browse Source

Merge pull request #4732 from xiang90/i_future_watch

integration: fix TestV3WatchFutureRevision
Xiang Li 9 years ago
parent
commit
19e39a36f7
1 changed files with 10 additions and 13 deletions
  1. 10 13
      integration/v3_watch_test.go

+ 10 - 13
integration/v3_watch_test.go

@@ -319,20 +319,17 @@ func TestV3WatchFutureRevision(t *testing.T) {
 		t.Fatal("create = %v, want %v", cresp.Created, true)
 	}
 
-	// asynchronously create keys
-	go func() {
-		kvc := toGRPC(clus.RandClient()).KV
-		for {
-			req := &pb.PutRequest{Key: wkey, Value: []byte("bar")}
-			resp, rerr := kvc.Put(context.TODO(), req)
-			if rerr != nil {
-				t.Fatalf("couldn't put key (%v)", rerr)
-			}
-			if resp.Header.Revision == wrev {
-				return
-			}
+	kvc := toGRPC(clus.RandClient()).KV
+	for {
+		req := &pb.PutRequest{Key: wkey, Value: []byte("bar")}
+		resp, rerr := kvc.Put(context.TODO(), req)
+		if rerr != nil {
+			t.Fatalf("couldn't put key (%v)", rerr)
 		}
-	}()
+		if resp.Header.Revision == wrev {
+			break
+		}
+	}
 
 	// ensure watcher request created a new watcher
 	cresp, err = wStream.Recv()