mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #4732 from xiang90/i_future_watch
integration: fix TestV3WatchFutureRevision
This commit is contained in:
commit
19e39a36f7
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user