mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
clientv3: close balancer to avoid goroutine leak in balancer_test.go
This commit is contained in:
parent
3f515e1849
commit
7a25257fb2
@ -29,6 +29,7 @@ var (
|
|||||||
|
|
||||||
func TestBalancerGetUnblocking(t *testing.T) {
|
func TestBalancerGetUnblocking(t *testing.T) {
|
||||||
sb := newSimpleBalancer(endpoints)
|
sb := newSimpleBalancer(endpoints)
|
||||||
|
defer sb.Close()
|
||||||
if addrs := <-sb.Notify(); len(addrs) != len(endpoints) {
|
if addrs := <-sb.Notify(); len(addrs) != len(endpoints) {
|
||||||
t.Errorf("Initialize newSimpleBalancer should have triggered Notify() chan, but it didn't")
|
t.Errorf("Initialize newSimpleBalancer should have triggered Notify() chan, but it didn't")
|
||||||
}
|
}
|
||||||
@ -72,6 +73,7 @@ func TestBalancerGetUnblocking(t *testing.T) {
|
|||||||
|
|
||||||
func TestBalancerGetBlocking(t *testing.T) {
|
func TestBalancerGetBlocking(t *testing.T) {
|
||||||
sb := newSimpleBalancer(endpoints)
|
sb := newSimpleBalancer(endpoints)
|
||||||
|
defer sb.Close()
|
||||||
if addrs := <-sb.Notify(); len(addrs) != len(endpoints) {
|
if addrs := <-sb.Notify(); len(addrs) != len(endpoints) {
|
||||||
t.Errorf("Initialize newSimpleBalancer should have triggered Notify() chan, but it didn't")
|
t.Errorf("Initialize newSimpleBalancer should have triggered Notify() chan, but it didn't")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user