(t *testing.T, e env)
| 3601 | } |
| 3602 | |
| 3603 | func testClientStreamingError(t *testing.T, e env) { |
| 3604 | te := newTest(t, e) |
| 3605 | te.startServer(&testServer{security: e.security, earlyFail: true}) |
| 3606 | defer te.tearDown() |
| 3607 | tc := testgrpc.NewTestServiceClient(te.clientConn()) |
| 3608 | |
| 3609 | stream, err := tc.StreamingInputCall(te.ctx) |
| 3610 | if err != nil { |
| 3611 | t.Fatalf("%v.StreamingInputCall(_) = _, %v, want <nil>", tc, err) |
| 3612 | } |
| 3613 | payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, 1) |
| 3614 | if err != nil { |
| 3615 | t.Fatal(err) |
| 3616 | } |
| 3617 | |
| 3618 | req := &testpb.StreamingInputCallRequest{ |
| 3619 | Payload: payload, |
| 3620 | } |
| 3621 | // The 1st request should go through. |
| 3622 | if err := stream.Send(req); err != nil { |
| 3623 | t.Fatalf("%v.Send(%v) = %v, want <nil>", stream, req, err) |
| 3624 | } |
| 3625 | for { |
| 3626 | if err := stream.Send(req); err != io.EOF { |
| 3627 | continue |
| 3628 | } |
| 3629 | if _, err := stream.CloseAndRecv(); status.Code(err) != codes.NotFound { |
| 3630 | t.Fatalf("%v.CloseAndRecv() = %v, want error %s", stream, err, codes.NotFound) |
| 3631 | } |
| 3632 | break |
| 3633 | } |
| 3634 | } |
| 3635 | |
| 3636 | // Tests that a client receives a cardinality violation error for client-streaming |
| 3637 | // RPCs if the server doesn't send a message before returning status OK. |
no test coverage detected