@@ -3736,42 +3736,6 @@ func (s) TestClientStreaming_ReturnErrorAfterSendAndClose(t *testing.T) {
37363736 }
37373737}
37383738
3739- // Tests for a successful RPC, client will receive io.EOF for second call to RecvMsg().
3740- func (s ) TestClientStreaming_ClientCallRecvMsgTwice (t * testing.T ) {
3741- ss := stubserver.StubServer {
3742- StreamingInputCallF : func (stream testgrpc.TestService_StreamingInputCallServer ) error {
3743- if err := stream .SendAndClose (& testpb.StreamingInputCallResponse {}); err != nil {
3744- t .Errorf ("stream.SendAndClose(_) = %v, want <nil>" , err )
3745- }
3746- return nil
3747- },
3748- }
3749- if err := ss .Start (nil ); err != nil {
3750- t .Fatal ("Error starting server:" , err )
3751- }
3752- defer ss .Stop ()
3753-
3754- ctx , cancel := context .WithTimeout (context .Background (), defaultTestTimeout )
3755- defer cancel ()
3756- stream , err := ss .Client .StreamingInputCall (ctx )
3757- if err != nil {
3758- t .Fatalf (".StreamingInputCall(_) = _, %v, want <nil>" , err )
3759- }
3760- if err := stream .Send (& testpb.StreamingInputCallRequest {}); err != nil {
3761- t .Fatalf ("stream.Send(_) = %v, want <nil>" , err )
3762- }
3763- if err := stream .CloseSend (); err != nil {
3764- t .Fatalf ("stream.CloseSend() = %v, want <nil>" , err )
3765- }
3766- resp := new (testpb.StreamingInputCallResponse )
3767- if err := stream .RecvMsg (resp ); err != nil {
3768- t .Fatalf ("stream.RecvMsg() = %v , want <nil>" , err )
3769- }
3770- if err := stream .RecvMsg (resp ); err != io .EOF {
3771- t .Fatalf ("stream.RecvMsg() = %v, want error %s" , err , io .EOF )
3772- }
3773- }
3774-
37753739// Tests that a client receives a cardinality violation error for unary
37763740// RPCs if the server doesn't send a message before returning status OK.
37773741func (s ) TestUnaryRPC_ServerSendsOnlyTrailersWithOK (t * testing.T ) {
@@ -3816,42 +3780,6 @@ func (s) TestUnaryRPC_ServerSendsOnlyTrailersWithOK(t *testing.T) {
38163780 }
38173781}
38183782
3819- // Tests for a successful unary RPC, client will receive io.EOF for second call to RecvMsg().
3820- func (s ) TestUnaryRPC_ClientCallRecvMsgTwice (t * testing.T ) {
3821- e := tcpTLSEnv
3822- te := newTest (t , e )
3823- defer te .tearDown ()
3824-
3825- te .startServer (& testServer {security : e .security })
3826-
3827- cc := te .clientConn ()
3828- ctx , cancel := context .WithTimeout (context .Background (), defaultTestTimeout )
3829- defer cancel ()
3830-
3831- desc := & grpc.StreamDesc {
3832- StreamName : "UnaryCall" ,
3833- ServerStreams : false ,
3834- ClientStreams : false ,
3835- }
3836- stream , err := cc .NewStream (ctx , desc , "/grpc.testing.TestService/UnaryCall" )
3837- if err != nil {
3838- t .Fatalf ("cc.NewStream() failed unexpectedly: %v" , err )
3839- }
3840-
3841- if err := stream .SendMsg (& testpb.SimpleRequest {}); err != nil {
3842- t .Fatalf ("stream.SendMsg(_) = %v, want <nil>" , err )
3843- }
3844-
3845- resp := & testpb.SimpleResponse {}
3846- if err := stream .RecvMsg (resp ); err != nil {
3847- t .Fatalf ("stream.RecvMsg() = %v , want <nil>" , err )
3848- }
3849-
3850- if err = stream .RecvMsg (resp ); err != io .EOF {
3851- t .Fatalf ("stream.RecvMsg() = %v, want error %s" , err , io .EOF )
3852- }
3853- }
3854-
38553783func (s ) TestExceedMaxStreamsLimit (t * testing.T ) {
38563784 for _ , e := range listTestEnv () {
38573785 testExceedMaxStreamsLimit (t , e )
0 commit comments