(t *testing.T, e env)
| 2262 | } |
| 2263 | |
| 2264 | func testLargeUnary(t *testing.T, e env) { |
| 2265 | te := newTest(t, e) |
| 2266 | te.startServer(&testServer{security: e.security}) |
| 2267 | defer te.tearDown() |
| 2268 | tc := testgrpc.NewTestServiceClient(te.clientConn()) |
| 2269 | |
| 2270 | const argSize = 271828 |
| 2271 | const respSize = 314159 |
| 2272 | |
| 2273 | payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, argSize) |
| 2274 | if err != nil { |
| 2275 | t.Fatal(err) |
| 2276 | } |
| 2277 | |
| 2278 | req := &testpb.SimpleRequest{ |
| 2279 | ResponseType: testpb.PayloadType_COMPRESSABLE, |
| 2280 | ResponseSize: respSize, |
| 2281 | Payload: payload, |
| 2282 | } |
| 2283 | |
| 2284 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 2285 | defer cancel() |
| 2286 | reply, err := tc.UnaryCall(ctx, req) |
| 2287 | if err != nil { |
| 2288 | t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, <nil>", err) |
| 2289 | } |
| 2290 | pt := reply.GetPayload().GetType() |
| 2291 | ps := len(reply.GetPayload().GetBody()) |
| 2292 | if pt != testpb.PayloadType_COMPRESSABLE || ps != respSize { |
| 2293 | t.Fatalf("Got the reply with type %d len %d; want %d, %d", pt, ps, testpb.PayloadType_COMPRESSABLE, respSize) |
| 2294 | } |
| 2295 | } |
| 2296 | |
| 2297 | // Test backward-compatibility API for setting msg size limit. |
| 2298 | func (s) TestExceedMsgLimit(t *testing.T) { |
no test coverage detected