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

Method TestDialContextCancel

dial_test.go:204–210  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

202}
203
204func (s) TestDialContextCancel(t *testing.T) {
205 ctx, cancel := context.WithCancel(context.Background())
206 cancel()
207 if _, err := DialContext(ctx, "Non-Existent.Server:80", WithBlock(), WithTransportCredentials(insecure.NewCredentials())); err != context.Canceled {
208 t.Fatalf("DialContext(%v, _) = _, %v, want _, %v", ctx, err, context.Canceled)
209 }
210}
211
212type failFastError struct{}
213

Callers

nothing calls this directly

Calls 5

NewCredentialsFunction · 0.92
DialContextFunction · 0.85
WithBlockFunction · 0.85
WithTransportCredentialsFunction · 0.85
FatalfMethod · 0.65

Tested by

no test coverage detected