@@ -3589,6 +3589,9 @@ func testClientStreamingError(t *testing.T, e env) {
3589
3589
// Tests that a client receives a cardinality violation error for client-streaming
3590
3590
// RPCs if the server doesn't send a message before returning status OK.
3591
3591
func (s ) TestClientStreamingCardinalityViolation_ServerHandlerMissingSendAndClose (t * testing.T ) {
3592
+ // TODO : https://github.com/grpc/grpc-go/issues/8119 - remove `t.Skip()`
3593
+ // after this is fixed.
3594
+ t .Skip ()
3592
3595
ss := & stubserver.StubServer {
3593
3596
StreamingInputCallF : func (_ testgrpc.TestService_StreamingInputCallServer ) error {
3594
3597
// Returning status OK without sending a response message.This is a
@@ -3737,113 +3740,8 @@ func (s) TestClientStreaming_ReturnErrorAfterSendAndClose(t *testing.T) {
3737
3740
}
3738
3741
}
3739
3742
3740
- // Tests that a client receives a cardinality violation error for unary
3741
- // RPCs if the server doesn't send a message before returning status OK.
3742
- func (s ) TestUnaryRPC_ServerSendsOnlyTrailersWithOK (t * testing.T ) {
3743
- lis , err := testutils .LocalTCPListener ()
3744
- if err != nil {
3745
- t .Fatal (err )
3746
- }
3747
- defer lis .Close ()
3748
-
3749
- ss := grpc .UnknownServiceHandler (func (any , grpc.ServerStream ) error {
3750
- return nil
3751
- })
3752
-
3753
- s := grpc .NewServer (ss )
3754
- go s .Serve (lis )
3755
- defer s .Stop ()
3756
-
3757
- ctx , cancel := context .WithTimeout (context .Background (), defaultTestTimeout )
3758
- defer cancel ()
3759
- cc , err := grpc .NewClient (lis .Addr ().String (), grpc .WithTransportCredentials (insecure .NewCredentials ()))
3760
- if err != nil {
3761
- t .Fatalf ("grpc.NewClient(%q) failed unexpectedly: %v" , lis .Addr (), err )
3762
- }
3763
- defer cc .Close ()
3764
-
3765
- client := testgrpc .NewTestServiceClient (cc )
3766
- if _ , err = client .EmptyCall (ctx , & testpb.Empty {}); status .Code (err ) != codes .Internal {
3767
- t .Errorf ("stream.RecvMsg() = %v, want error %v" , status .Code (err ), codes .Internal )
3768
- }
3769
- }
3770
-
3771
- // Tests that client will receive cardinality violations when calling
3772
- // RecvMsg() multiple times for non-streaming response streams.
3773
- func (s ) TestUnaryRPC_ClientCallRecvMsgTwice (t * testing.T ) {
3774
- e := tcpTLSEnv
3775
- te := newTest (t , e )
3776
- defer te .tearDown ()
3777
-
3778
- te .startServer (& testServer {security : e .security })
3779
-
3780
- cc := te .clientConn ()
3781
- ctx , cancel := context .WithTimeout (context .Background (), defaultTestTimeout )
3782
- defer cancel ()
3783
-
3784
- desc := & grpc.StreamDesc {
3785
- StreamName : "UnaryCall" ,
3786
- ServerStreams : false ,
3787
- ClientStreams : false ,
3788
- }
3789
- stream , err := cc .NewStream (ctx , desc , "/grpc.testing.TestService/UnaryCall" )
3790
- if err != nil {
3791
- t .Fatalf ("cc.NewStream() failed unexpectedly: %v" , err )
3792
- }
3793
-
3794
- if err := stream .SendMsg (& testpb.SimpleRequest {}); err != nil {
3795
- t .Fatalf ("stream.SendMsg(_) = %v, want <nil>" , err )
3796
- }
3797
-
3798
- resp := & testpb.SimpleResponse {}
3799
- if err := stream .RecvMsg (resp ); err != nil {
3800
- t .Fatalf ("stream.RecvMsg() = %v , want <nil>" , err )
3801
- }
3802
-
3803
- if err = stream .RecvMsg (resp ); status .Code (err ) != codes .Internal {
3804
- t .Errorf ("stream.RecvMsg() = %v, want error %v" , status .Code (err ), codes .Internal )
3805
- }
3806
- }
3807
-
3808
- // Tests that client will receive cardinality violations when calling
3809
- // RecvMsg() multiple times for non-streaming response streams.
3810
- func (s ) TestClientStreaming_ClientCallRecvMsgTwice (t * testing.T ) {
3811
- ss := stubserver.StubServer {
3812
- StreamingInputCallF : func (stream testgrpc.TestService_StreamingInputCallServer ) error {
3813
- if err := stream .SendAndClose (& testpb.StreamingInputCallResponse {}); err != nil {
3814
- t .Errorf ("stream.SendAndClose(_) = %v, want <nil>" , err )
3815
- }
3816
- return nil
3817
- },
3818
- }
3819
- if err := ss .Start (nil ); err != nil {
3820
- t .Fatal ("Error starting server:" , err )
3821
- }
3822
- defer ss .Stop ()
3823
-
3824
- ctx , cancel := context .WithTimeout (context .Background (), defaultTestTimeout )
3825
- defer cancel ()
3826
- stream , err := ss .Client .StreamingInputCall (ctx )
3827
- if err != nil {
3828
- t .Fatalf (".StreamingInputCall(_) = _, %v, want <nil>" , err )
3829
- }
3830
- if err := stream .Send (& testpb.StreamingInputCallRequest {}); err != nil {
3831
- t .Fatalf ("stream.Send(_) = %v, want <nil>" , err )
3832
- }
3833
- if err := stream .CloseSend (); err != nil {
3834
- t .Fatalf ("stream.CloseSend() = %v, want <nil>" , err )
3835
- }
3836
- resp := new (testpb.StreamingInputCallResponse )
3837
- if err := stream .RecvMsg (resp ); err != nil {
3838
- t .Fatalf ("stream.RecvMsg() = %v , want <nil>" , err )
3839
- }
3840
- if err = stream .RecvMsg (resp ); status .Code (err ) != codes .Internal {
3841
- t .Errorf ("stream.RecvMsg() = %v, want error %v" , status .Code (err ), codes .Internal )
3842
- }
3843
- }
3844
-
3845
3743
// Tests that a client receives a cardinality violation error for client-streaming
3846
- // RPCs if the server call SendMsg() multiple times.
3744
+ // RPCs if the server call SendMsg multiple times.
3847
3745
func (s ) TestClientStreaming_ServerHandlerSendMsgAfterSendMsg (t * testing.T ) {
3848
3746
ss := stubserver.StubServer {
3849
3747
StreamingInputCallF : func (stream testgrpc.TestService_StreamingInputCallServer ) error {
0 commit comments