Browse Source

clientv3/integration: give more time for balancer resolution

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
Gyuho Lee 6 years ago
parent
commit
ba42e65b59
1 changed files with 6 additions and 3 deletions
  1. 6 3
      clientv3/integration/black_hole_test.go

+ 6 - 3
clientv3/integration/black_hole_test.go

@@ -36,7 +36,7 @@ func TestBalancerUnderBlackholeKeepAliveWatch(t *testing.T) {
 
 	clus := integration.NewClusterV3(t, &integration.ClusterConfig{
 		Size:                 2,
-		GRPCKeepAliveMinTime: 1 * time.Millisecond, // avoid too_many_pings
+		GRPCKeepAliveMinTime: time.Millisecond, // avoid too_many_pings
 	})
 	defer clus.Terminate(t)
 
@@ -44,9 +44,9 @@ func TestBalancerUnderBlackholeKeepAliveWatch(t *testing.T) {
 
 	ccfg := clientv3.Config{
 		Endpoints:            []string{eps[0]},
-		DialTimeout:          1 * time.Second,
+		DialTimeout:          time.Second,
 		DialOptions:          []grpc.DialOption{grpc.WithBlock()},
-		DialKeepAliveTime:    1 * time.Second,
+		DialKeepAliveTime:    time.Second,
 		DialKeepAliveTimeout: 500 * time.Millisecond,
 	}
 
@@ -72,6 +72,9 @@ func TestBalancerUnderBlackholeKeepAliveWatch(t *testing.T) {
 	// endpoint can switch to eps[1] when it detects the failure of eps[0]
 	cli.SetEndpoints(eps...)
 
+	// give enough time for balancer resolution
+	time.Sleep(5 * time.Second)
+
 	clus.Members[0].Blackhole()
 
 	if _, err = clus.Client(1).Put(context.TODO(), "foo", "bar"); err != nil {