Merge pull request #10900 from yuzeming/master
integration: add WaitGroup to TestV3WatchCurrentPutOverlaprelease-3.4
commit
7d2e57216a
|
@ -479,8 +479,11 @@ func TestV3WatchCurrentPutOverlap(t *testing.T) {
|
||||||
// last mod_revision that will be observed
|
// last mod_revision that will be observed
|
||||||
nrRevisions := 32
|
nrRevisions := 32
|
||||||
// first revision already allocated as empty revision
|
// first revision already allocated as empty revision
|
||||||
|
var wg sync.WaitGroup
|
||||||
for i := 1; i < nrRevisions; i++ {
|
for i := 1; i < nrRevisions; i++ {
|
||||||
|
wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
|
defer wg.Done()
|
||||||
kvc := toGRPC(clus.RandClient()).KV
|
kvc := toGRPC(clus.RandClient()).KV
|
||||||
req := &pb.PutRequest{Key: []byte("foo"), Value: []byte("bar")}
|
req := &pb.PutRequest{Key: []byte("foo"), Value: []byte("bar")}
|
||||||
if _, err := kvc.Put(context.TODO(), req); err != nil {
|
if _, err := kvc.Put(context.TODO(), req); err != nil {
|
||||||
|
@ -540,6 +543,8 @@ func TestV3WatchCurrentPutOverlap(t *testing.T) {
|
||||||
if rok, nr := waitResponse(wStream, time.Second); !rok {
|
if rok, nr := waitResponse(wStream, time.Second); !rok {
|
||||||
t.Errorf("unexpected pb.WatchResponse is received %+v", nr)
|
t.Errorf("unexpected pb.WatchResponse is received %+v", nr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wg.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestV3WatchEmptyKey ensures synced watchers see empty key PUTs as PUT events
|
// TestV3WatchEmptyKey ensures synced watchers see empty key PUTs as PUT events
|
||||||
|
|
Loading…
Reference in New Issue