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

Method TestWithConnectParams

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

Source from the content-addressed store, hash-verified

412}
413
414func (s) TestWithConnectParams(t *testing.T) {
415 bd := 2 * time.Second
416 mltpr := 2.0
417 jitter := 0.0
418 bc := backoff.Config{BaseDelay: bd, Multiplier: mltpr, Jitter: jitter}
419
420 crt := ConnectParams{Backoff: bc}
421 // MaxDelay is not set in the ConnectParams. So it should not be set on
422 // internalbackoff.Exponential as well.
423 wantBackoff := internalbackoff.Exponential{Config: bc}
424 testBackoffConfigSet(t, wantBackoff, WithConnectParams(crt))
425}
426
427func testBackoffConfigSet(t *testing.T, wantBackoff internalbackoff.Exponential, opts ...DialOption) {
428 opts = append(opts, WithTransportCredentials(insecure.NewCredentials()))

Callers

nothing calls this directly

Calls 2

testBackoffConfigSetFunction · 0.85
WithConnectParamsFunction · 0.85

Tested by

no test coverage detected