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

Method TestNonFailFastRPCSucceedOnTimeoutCreds

test/creds_test.go:171–185  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

169}
170
171func (s) TestNonFailFastRPCSucceedOnTimeoutCreds(t *testing.T) {
172 te := newTest(t, env{name: "timeout-cred", network: "tcp", security: "empty"})
173 te.userAgent = testAppUA
174 te.startServer(&testServer{security: te.e.security})
175 defer te.tearDown()
176
177 cc := te.clientConn(grpc.WithTransportCredentials(&clientTimeoutCreds{}))
178 tc := testgrpc.NewTestServiceClient(cc)
179 ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
180 defer cancel()
181 // This unary call should succeed, because ClientHandshake will succeed for the second time.
182 if _, err := tc.EmptyCall(ctx, &testpb.Empty{}, grpc.WaitForReady(true)); err != nil {
183 te.t.Fatalf("TestService/EmptyCall(_, _) = _, %v, want <nil>", err)
184 }
185}
186
187type methodTestCreds struct{}
188

Callers

nothing calls this directly

Calls 8

EmptyCallMethod · 0.95
WithTransportCredentialsFunction · 0.92
WaitForReadyFunction · 0.92
newTestFunction · 0.70
FatalfMethod · 0.65
startServerMethod · 0.45
tearDownMethod · 0.45
clientConnMethod · 0.45

Tested by

no test coverage detected