mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
clientv3: send frst down() func after recieving first notified addr
This ensures the ordering of down and up calls.
This commit is contained in:
parent
8baaa06cce
commit
310641630e
@ -95,10 +95,11 @@ func TestBalancerGetBlocking(t *testing.T) {
|
||||
go func() {
|
||||
// ensure sb.Up() will be called after sb.Get() to see if Up() releases blocking Get()
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
downC <- sb.Up(grpc.Address{Addr: endpoints[1]})
|
||||
f := sb.Up(grpc.Address{Addr: endpoints[1]})
|
||||
if addrs := <-sb.Notify(); len(addrs) != 1 {
|
||||
t.Errorf("first Up() should have triggered balancer to send the first connected address via Notify chan so that other connections can be closed")
|
||||
}
|
||||
downC <- f
|
||||
}()
|
||||
addrFirst, putFun, err := sb.Get(context.Background(), blockingOpts)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user