Browse Source

Merge pull request #6007 from heyitsanthony/fix-watch-test

integration: fix race in TestV3WatchMultipleEventsTxnSynced
Anthony Romano 9 years ago
parent
commit
a7b098b26d
1 changed files with 3 additions and 3 deletions
  1. 3 3
      integration/v3_watch_test.go

+ 3 - 3
integration/v3_watch_test.go

@@ -672,6 +672,9 @@ func testV3WatchMultipleEventsTxn(t *testing.T, startRev int64) {
 	if err := wStream.Send(wreq); err != nil {
 		t.Fatalf("wStream.Send error: %v", err)
 	}
+	if resp, err := wStream.Recv(); err != nil || resp.Created == false {
+		t.Fatalf("create response failed: resp=%v, err=%v", resp, err)
+	}
 
 	kvc := toGRPC(clus.RandClient()).KV
 	txn := pb.TxnRequest{}
@@ -697,9 +700,6 @@ func testV3WatchMultipleEventsTxn(t *testing.T, startRev int64) {
 		if err != nil {
 			t.Errorf("wStream.Recv error: %v", err)
 		}
-		if resp.Created {
-			continue
-		}
 		events = append(events, resp.Events...)
 	}
 	sort.Sort(eventsSortByKey(events))