|
@@ -79,20 +79,15 @@ func TestDialTLSNoConfig(t *testing.T) {
|
|
|
DialTimeout: time.Second,
|
|
DialTimeout: time.Second,
|
|
|
DialOptions: []grpc.DialOption{grpc.WithBlock()},
|
|
DialOptions: []grpc.DialOption{grpc.WithBlock()},
|
|
|
})
|
|
})
|
|
|
- if err != nil {
|
|
|
|
|
- t.Fatal(err)
|
|
|
|
|
- }
|
|
|
|
|
- defer c.Close()
|
|
|
|
|
-
|
|
|
|
|
- // TODO: this should not be required when we set grpc.WithBlock()
|
|
|
|
|
- if c != nil {
|
|
|
|
|
- ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
|
|
|
|
|
- _, err = c.KV.Get(ctx, "/")
|
|
|
|
|
- cancel()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ defer func() {
|
|
|
|
|
+ if c != nil {
|
|
|
|
|
+ c.Close()
|
|
|
|
|
+ }
|
|
|
|
|
+ }()
|
|
|
if !isClientTimeout(err) {
|
|
if !isClientTimeout(err) {
|
|
|
t.Fatalf("expected dial timeout error, got %v", err)
|
|
t.Fatalf("expected dial timeout error, got %v", err)
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// TestDialSetEndpointsBeforeFail ensures SetEndpoints can replace unavailable
|
|
// TestDialSetEndpointsBeforeFail ensures SetEndpoints can replace unavailable
|