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

Method TestBackoffCancel

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

Source from the content-addressed store, hash-verified

646}
647
648func (s) TestBackoffCancel(t *testing.T) {
649 dialStrCh := make(chan string)
650 cc, err := NewClient("passthrough:///", WithTransportCredentials(insecure.NewCredentials()), WithDialer(func(t string, _ time.Duration) (net.Conn, error) {
651 dialStrCh <- t
652 return nil, fmt.Errorf("test dialer, always error")
653 }))
654 if err != nil {
655 t.Fatalf("grpc.NewClient() failed: %v", err)
656 }
657 cc.Connect()
658 defer cc.Close()
659
660 select {
661 case <-time.After(defaultTestTimeout):
662 t.Fatal("Timeout when waiting for custom dialer to be invoked during Connect()")
663 case <-dialStrCh:
664 }
665}
666
667// TestUpdateAddresses_NoopIfCalledWithSameAddresses tests that UpdateAddresses
668// should be noop if UpdateAddresses is called with the same list of addresses,

Callers

nothing calls this directly

Calls 9

NewCredentialsFunction · 0.92
WithTransportCredentialsFunction · 0.85
WithDialerFunction · 0.85
NewClientFunction · 0.70
ErrorfMethod · 0.65
FatalfMethod · 0.65
ConnectMethod · 0.65
CloseMethod · 0.65
FatalMethod · 0.65

Tested by

no test coverage detected