Skip to content

Commit

Permalink
integration: fix "TestV3WatchMultipleStreams"
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
  • Loading branch information
gyuho committed Jun 2, 2018
1 parent 0940d6d commit 49bfbb1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions integration/v3_watch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,7 @@ func testV3WatchMultipleStreams(t *testing.T, startRev int64) {
Kv: &mvccpb.KeyValue{Key: []byte("foo"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1},
},
}
ids := make(map[int64]struct{})
for i := range streams {
go func(i int) {
defer wg.Done()
Expand All @@ -929,9 +930,10 @@ func testV3WatchMultipleStreams(t *testing.T, startRev int64) {
if err != nil {
t.Fatalf("wStream.Recv error: %v", err)
}
if wresp.WatchId != 0 {
t.Errorf("watchId got = %d, want = 0", wresp.WatchId)
if _, ok := ids[wresp.WatchId]; ok {
t.Fatalf("duplicate watch ID found %d", wresp.WatchId)
}
ids[wresp.WatchId] = struct{}{}
if !reflect.DeepEqual(wresp.Events, wevents) {
t.Errorf("wresp.Events got = %+v, want = %+v", wresp.Events, wevents)
}
Expand Down

0 comments on commit 49bfbb1

Please sign in to comment.