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

Method TestWithTimeout

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

Source from the content-addressed store, hash-verified

173}
174
175func (s) TestWithTimeout(t *testing.T) {
176 conn, err := Dial("passthrough:///Non-Existent.Server:80",
177 WithTimeout(time.Millisecond),
178 WithBlock(),
179 WithTransportCredentials(insecure.NewCredentials()))
180 if err == nil {
181 conn.Close()
182 }
183 if err != context.DeadlineExceeded {
184 t.Fatalf("Dial(_, _) = %v, %v, want %v", conn, err, context.DeadlineExceeded)
185 }
186}
187
188func (s) TestWithTransportCredentialsTLS(t *testing.T) {
189 ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond)

Callers

nothing calls this directly

Calls 7

NewCredentialsFunction · 0.92
WithTimeoutFunction · 0.85
WithBlockFunction · 0.85
WithTransportCredentialsFunction · 0.85
DialFunction · 0.70
CloseMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected