mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
clientv3/integration: Get with context timeout
Address https://github.com/coreos/etcd/pull/8762#discussion_r147019068. Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
995d79a0fc
commit
8fa35216b0
@ -48,7 +48,12 @@ func TestBalancerUnderServerShutdownWatch(t *testing.T) {
|
||||
defer watchCli.Close()
|
||||
|
||||
// wait for eps[lead] to be pinned
|
||||
watchCli.Get(context.Background(), "foo")
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
|
||||
_, err = watchCli.Get(ctx, "foo")
|
||||
cancel()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// add all eps to list, so that when the original pined one fails
|
||||
// the client can switch to other available eps
|
||||
|
Loading…
x
Reference in New Issue
Block a user