(t *testing.T, e env)
| 3412 | } |
| 3413 | |
| 3414 | func testFailedServerStreaming(t *testing.T, e env) { |
| 3415 | te := newTest(t, e) |
| 3416 | te.userAgent = failAppUA |
| 3417 | te.startServer(&testServer{security: e.security}) |
| 3418 | defer te.tearDown() |
| 3419 | tc := testgrpc.NewTestServiceClient(te.clientConn()) |
| 3420 | |
| 3421 | respParam := make([]*testpb.ResponseParameters, len(respSizes)) |
| 3422 | for i, s := range respSizes { |
| 3423 | respParam[i] = &testpb.ResponseParameters{ |
| 3424 | Size: int32(s), |
| 3425 | } |
| 3426 | } |
| 3427 | req := &testpb.StreamingOutputCallRequest{ |
| 3428 | ResponseType: testpb.PayloadType_COMPRESSABLE, |
| 3429 | ResponseParameters: respParam, |
| 3430 | } |
| 3431 | ctx := metadata.NewOutgoingContext(te.ctx, testMetadata) |
| 3432 | stream, err := tc.StreamingOutputCall(ctx, req) |
| 3433 | if err != nil { |
| 3434 | t.Fatalf("%v.StreamingOutputCall(_) = _, %v, want <nil>", tc, err) |
| 3435 | } |
| 3436 | wantErr := status.Error(codes.DataLoss, "error for testing: "+failAppUA) |
| 3437 | if _, err := stream.Recv(); !equalError(err, wantErr) { |
| 3438 | t.Fatalf("%v.Recv() = _, %v, want _, %v", stream, err, wantErr) |
| 3439 | } |
| 3440 | } |
| 3441 | |
| 3442 | func equalError(x, y error) bool { |
| 3443 | return x == y || (x != nil && y != nil && x.Error() == y.Error()) |
no test coverage detected