(tc testgrpc.TestServiceClient, t *testing.T)
| 841 | } |
| 842 | |
| 843 | func doClientSideInitiatedFailedStream(tc testgrpc.TestServiceClient, t *testing.T) { |
| 844 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 845 | stream, err := tc.FullDuplexCall(ctx) |
| 846 | if err != nil { |
| 847 | t.Fatalf("TestService/FullDuplexCall(_) = _, %v, want <nil>", err) |
| 848 | } |
| 849 | |
| 850 | const smallSize = 1 |
| 851 | smallPayload, err := newPayload(testpb.PayloadType_COMPRESSABLE, smallSize) |
| 852 | if err != nil { |
| 853 | t.Fatal(err) |
| 854 | } |
| 855 | |
| 856 | sreq := &testpb.StreamingOutputCallRequest{ |
| 857 | ResponseType: testpb.PayloadType_COMPRESSABLE, |
| 858 | ResponseParameters: []*testpb.ResponseParameters{ |
| 859 | {Size: smallSize}, |
| 860 | }, |
| 861 | Payload: smallPayload, |
| 862 | } |
| 863 | |
| 864 | if err := stream.Send(sreq); err != nil { |
| 865 | t.Fatalf("%v.Send(%v) = %v, want <nil>", stream, sreq, err) |
| 866 | } |
| 867 | if _, err := stream.Recv(); err != nil { |
| 868 | t.Fatalf("%v.Recv() = %v, want <nil>", stream, err) |
| 869 | } |
| 870 | // By canceling the call, the client will send rst_stream to end the call, and |
| 871 | // the stream will failed as a result. |
| 872 | cancel() |
| 873 | } |
| 874 | |
| 875 | // This func is to be used to test client side counting of failed streams. |
| 876 | func doServerSideInitiatedFailedStreamWithRSTStream(tc testgrpc.TestServiceClient, t *testing.T, l *listenerWrapper) { |
no test coverage detected