|
@@ -48,7 +48,12 @@ func TestBalancerUnderServerShutdownWatch(t *testing.T) {
|
|
|
defer watchCli.Close()
|
|
defer watchCli.Close()
|
|
|
|
|
|
|
|
// wait for eps[lead] to be pinned
|
|
// 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
|
|
// add all eps to list, so that when the original pined one fails
|
|
|
// the client can switch to other available eps
|
|
// the client can switch to other available eps
|