clientv3/integration: add waitPinReady

RPC should be sent to trigger 'readyWait' on new pin address.
Otherwise, endpoints other than ep[0] may be pinned.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
This commit is contained in:
Gyu-Ho Lee
2017-10-26 13:51:19 -07:00
parent 9b26bde147
commit af53f54042
3 changed files with 37 additions and 6 deletions

View File

@ -70,6 +70,9 @@ func testBalancerUnderNetworkPartition(t *testing.T, op func(*clientv3.Client, c
}
defer cli.Close()
// wait for ep[0] to be pinned
waitPinReady(t, cli)
// add other endpoints for later endpoint switch
cli.SetEndpoints(clus.Members[0].GRPCAddr(), clus.Members[1].GRPCAddr(), clus.Members[2].GRPCAddr())
clus.Members[0].InjectPartition(t, clus.Members[1:]...)