mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
integration: fix race in TestV3WatchMultipleEventsTxnSynced
Writes between watcher creation request and reply were being dropped. Fixes #5789
This commit is contained in:
parent
aba478fb8a
commit
82ddeb38b4
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user