DoLargeUnaryCall performs a unary RPC with large payload in the request and response.
(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption)
| 88 | |
| 89 | // DoLargeUnaryCall performs a unary RPC with large payload in the request and response. |
| 90 | func 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. |
| 109 | func DoClientStreaming(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption) { |
no test coverage detected