mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Fixed goroutine leak in tests/integration/clientv3/watch_test.go
Signed-off-by: VladSaioc <vladsaioc10@gmail.com>
This commit is contained in:
parent
046c46e52e
commit
cbfddfe63f
@ -27,7 +27,7 @@ import (
|
||||
mvccpb "go.etcd.io/etcd/api/v3/mvccpb"
|
||||
"go.etcd.io/etcd/api/v3/v3rpc/rpctypes"
|
||||
"go.etcd.io/etcd/api/v3/version"
|
||||
"go.etcd.io/etcd/client/v3"
|
||||
clientv3 "go.etcd.io/etcd/client/v3"
|
||||
"go.etcd.io/etcd/server/v3/etcdserver/api/v3rpc"
|
||||
integration2 "go.etcd.io/etcd/tests/v3/framework/integration"
|
||||
"google.golang.org/grpc/metadata"
|
||||
@ -74,6 +74,12 @@ func testWatchMultiWatcher(t *testing.T, wctx *watchctx) {
|
||||
keys := []string{"foo", "bar", "baz"}
|
||||
|
||||
donec := make(chan struct{})
|
||||
// wait for watcher shutdown
|
||||
defer func() {
|
||||
for i := 0; i < len(keys)+1; i++ {
|
||||
<-donec
|
||||
}
|
||||
}()
|
||||
readyc := make(chan struct{})
|
||||
for _, k := range keys {
|
||||
// key watcher
|
||||
@ -156,10 +162,6 @@ func testWatchMultiWatcher(t *testing.T, wctx *watchctx) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// wait for watcher shutdown
|
||||
for i := 0; i < len(keys)+1; i++ {
|
||||
<-donec
|
||||
}
|
||||
}
|
||||
|
||||
// TestWatchRange tests watcher creates ranges
|
||||
|
Loading…
x
Reference in New Issue
Block a user