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

Method doUnaryCall

stats/stats_test.go:303–320  ·  view source on GitHub ↗
(c *rpcConfig)

Source from the content-addressed store, hash-verified

301}
302
303func (te *test) doUnaryCall(c *rpcConfig) (*testpb.SimpleRequest, *testpb.SimpleResponse, error) {
304 var (
305 resp *testpb.SimpleResponse
306 req *testpb.SimpleRequest
307 err error
308 )
309 tCtx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
310 defer cancel()
311 tc := testgrpc.NewTestServiceClient(te.clientConn(tCtx))
312 if c.success {
313 req = &testpb.SimpleRequest{Payload: idToPayload(errorID + 1)}
314 } else {
315 req = &testpb.SimpleRequest{Payload: idToPayload(errorID)}
316 }
317
318 resp, err = tc.UnaryCall(metadata.NewOutgoingContext(tCtx, testMetadata), req, grpc.WaitForReady(!c.failfast))
319 return req, resp, err
320}
321
322func (te *test) doFullDuplexCallRoundtrip(c *rpcConfig) ([]proto.Message, []proto.Message, error) {
323 var (

Callers 4

testServerStatsFunction · 0.45
testClientStatsFunction · 0.45

Calls 5

clientConnMethod · 0.95
UnaryCallMethod · 0.95
NewOutgoingContextFunction · 0.92
WaitForReadyFunction · 0.92
idToPayloadFunction · 0.70

Tested by

no test coverage detected