MCPcopy
hub / github.com/grpc/grpc-go / TestConnectParamsWithMinConnectTimeout

Method TestConnectParamsWithMinConnectTimeout

clientconn_test.go:449–461  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

447}
448
449func (s) TestConnectParamsWithMinConnectTimeout(t *testing.T) {
450 // Default value specified for minConnectTimeout in the spec is 20 seconds.
451 mct := 1 * time.Minute
452 conn, err := NewClient("passthrough:///foo:80", WithTransportCredentials(insecure.NewCredentials()), WithConnectParams(ConnectParams{MinConnectTimeout: mct}))
453 if err != nil {
454 t.Fatalf("grpc.NewClient() failed: %v", err)
455 }
456 defer conn.Close()
457
458 if got := conn.dopts.minConnectTimeout(); got != mct {
459 t.Errorf("unexpected minConnectTimeout on the connection: %v, want %v", got, mct)
460 }
461}
462
463func (s) TestResolverServiceConfigBeforeAddressNotPanic(t *testing.T) {
464 r := manual.NewBuilderWithScheme("whatever")

Callers

nothing calls this directly

Calls 7

NewCredentialsFunction · 0.92
WithTransportCredentialsFunction · 0.85
WithConnectParamsFunction · 0.85
NewClientFunction · 0.70
FatalfMethod · 0.65
CloseMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected