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

Function DoLargeUnaryCall

interop/test_utils.go:90–106  ·  view source on GitHub ↗

DoLargeUnaryCall performs a unary RPC with large payload in the request and response.

(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)

Source from the content-addressed store, hash-verified

88
89// DoLargeUnaryCall performs a unary RPC with large payload in the request and response.
90func DoLargeUnaryCall(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption) {
91 pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize)
92 req := &testpb.SimpleRequest{
93 ResponseType: testpb.PayloadType_COMPRESSABLE,
94 ResponseSize: int32(largeRespSize),
95 Payload: pl,
96 }
97 reply, err := tc.UnaryCall(ctx, req, args...)
98 if err != nil {
99 logger.Fatal("/TestService/UnaryCall RPC failed: ", err)
100 }
101 t := reply.GetPayload().GetType()
102 s := len(reply.GetPayload().GetBody())
103 if t != testpb.PayloadType_COMPRESSABLE || s != largeRespSize {
104 logger.Fatalf("Got the reply with type %d len %d; want %d, %d", t, s, testpb.PayloadType_COMPRESSABLE, largeRespSize)
105 }
106}
107
108// DoClientStreaming performs a client streaming RPC.
109func DoClientStreaming(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption) {

Callers 6

mainFunction · 0.92
mainFunction · 0.92
performRPCsFunction · 0.92
goawayFunction · 0.92
pingFunction · 0.92
maxStreamsFunction · 0.92

Calls 7

ClientNewPayloadFunction · 0.85
UnaryCallMethod · 0.65
FatalMethod · 0.65
FatalfMethod · 0.65
GetTypeMethod · 0.45
GetPayloadMethod · 0.45
GetBodyMethod · 0.45

Tested by

no test coverage detected