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

Method doUnaryCall

binarylog/binarylog_end2end_test.go:297–315  ·  view source on GitHub ↗
(c *rpcConfig)

Source from the content-addressed store, hash-verified

295}
296
297func (te *test) doUnaryCall(c *rpcConfig) (*testpb.SimpleRequest, *testpb.SimpleResponse, error) {
298 var (
299 resp *testpb.SimpleResponse
300 req *testpb.SimpleRequest
301 err error
302 )
303 tc := testgrpc.NewTestServiceClient(te.ss.CC)
304 if c.success {
305 req = &testpb.SimpleRequest{Payload: idToPayload(errorID + 1)}
306 } else {
307 req = &testpb.SimpleRequest{Payload: idToPayload(errorID)}
308 }
309 ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
310 defer cancel()
311 ctx = metadata.NewOutgoingContext(ctx, testMetadata)
312
313 resp, err = tc.UnaryCall(ctx, req)
314 return req, resp, err
315}
316
317func (te *test) doFullDuplexCallRoundtrip(c *rpcConfig) ([]proto.Message, []proto.Message, error) {
318 var (

Callers 1

runRPCsFunction · 0.45

Calls 3

UnaryCallMethod · 0.95
NewOutgoingContextFunction · 0.92
idToPayloadFunction · 0.70

Tested by

no test coverage detected