mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
clientv3/integration: test dialing to TLS without a TLS config times out
etcdctl was getting ctx errors from timing out trying to issue RPCs to a TLS endpoint but without using TLS for transmission. Client should immediately bail out with a time out error.
This commit is contained in:
parent
8effbda3a7
commit
1b48d6e5df
@ -66,6 +66,22 @@ func TestDialTLSExpired(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestDialTLSNoConfig ensures the client fails to dial / times out
|
||||||
|
// when TLS endpoints (https, unixs) are given but no tls config.
|
||||||
|
func TestDialTLSNoConfig(t *testing.T) {
|
||||||
|
defer testutil.AfterTest(t)
|
||||||
|
clus := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1, ClientTLS: &testTLSInfo})
|
||||||
|
defer clus.Terminate(t)
|
||||||
|
// expect 'signed by unknown authority'
|
||||||
|
_, err := clientv3.New(clientv3.Config{
|
||||||
|
Endpoints: []string{clus.Members[0].GRPCAddr()},
|
||||||
|
DialTimeout: time.Second,
|
||||||
|
})
|
||||||
|
if err != grpc.ErrClientConnTimeout {
|
||||||
|
t.Fatalf("expected %v, got %v", grpc.ErrClientConnTimeout, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TestDialSetEndpoints ensures SetEndpoints can replace unavailable endpoints with available ones.
|
// TestDialSetEndpoints ensures SetEndpoints can replace unavailable endpoints with available ones.
|
||||||
func TestDialSetEndpointsBeforeFail(t *testing.T) {
|
func TestDialSetEndpointsBeforeFail(t *testing.T) {
|
||||||
testDialSetEndpoints(t, true)
|
testDialSetEndpoints(t, true)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user