From 7e0a5b8ed7c973860997203ef15170d4f954bb9b Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Tue, 19 Jan 2016 12:30:49 -0800 Subject: [PATCH] integration: fix race in WatchFromCurrentRevision Since watching from current revision, keys should be put after the watcher is registered or the test may time out. Shows up in CI. --- integration/v3_grpc_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration/v3_grpc_test.go b/integration/v3_grpc_test.go index 835b9d9f2..ebd66d8b7 100644 --- a/integration/v3_grpc_test.go +++ b/integration/v3_grpc_test.go @@ -369,6 +369,10 @@ func TestV3WatchFromCurrentRevision(t *testing.T) { t.Fatalf("#%d: wAPI.Watch error: %v", i, err) } + if err := wStream.Send(tt.watchRequest); err != nil { + t.Fatalf("#%d: wStream.Send error: %v", i, err) + } + go func() { for _, k := range tt.putKeys { kvc := pb.NewKVClient(clus.RandConn()) @@ -379,10 +383,6 @@ func TestV3WatchFromCurrentRevision(t *testing.T) { } }() - if err := wStream.Send(tt.watchRequest); err != nil { - t.Fatalf("#%d: wStream.Send error: %v", i, err) - } - var createdWatchId int64 for j, wresp := range tt.wresps { resp, err := wStream.Recv()