mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
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.
This commit is contained in:
parent
9ca3c8e581
commit
7e0a5b8ed7
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user