From 714db19b0b552fbd25ed94c5bfb676527cf63831 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 30 Jun 2016 14:44:55 -0700 Subject: [PATCH 01/13] Add response_status field to test.proto. --- interop/grpc_testing/test.pb.go | 147 +++++++++++++++++++++----------- interop/grpc_testing/test.proto | 13 +++ 2 files changed, 112 insertions(+), 48 deletions(-) diff --git a/interop/grpc_testing/test.pb.go b/interop/grpc_testing/test.pb.go index 0ceb12df..54ead93b 100755 --- a/interop/grpc_testing/test.pb.go +++ b/interop/grpc_testing/test.pb.go @@ -11,6 +11,7 @@ It is generated from these files: It has these top-level messages: Empty Payload + EchoStatus SimpleRequest SimpleResponse StreamingInputCallRequest @@ -119,6 +120,33 @@ func (m *Payload) GetBody() []byte { return nil } +// A protobuf representation for grpc status. This is used by test +// clients to specify a status that the server should attempt to return. +type EchoStatus struct { + Code *int32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Message *string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *EchoStatus) Reset() { *m = EchoStatus{} } +func (m *EchoStatus) String() string { return proto.CompactTextString(m) } +func (*EchoStatus) ProtoMessage() {} +func (*EchoStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *EchoStatus) GetCode() int32 { + if m != nil && m.Code != nil { + return *m.Code + } + return 0 +} + +func (m *EchoStatus) GetMessage() string { + if m != nil && m.Message != nil { + return *m.Message + } + return "" +} + // Unary request. type SimpleRequest struct { // Desired payload type in the response from the server. @@ -132,14 +160,16 @@ type SimpleRequest struct { // Whether SimpleResponse should include username. FillUsername *bool `protobuf:"varint,4,opt,name=fill_username,json=fillUsername" json:"fill_username,omitempty"` // Whether SimpleResponse should include OAuth scope. - FillOauthScope *bool `protobuf:"varint,5,opt,name=fill_oauth_scope,json=fillOauthScope" json:"fill_oauth_scope,omitempty"` - XXX_unrecognized []byte `json:"-"` + FillOauthScope *bool `protobuf:"varint,5,opt,name=fill_oauth_scope,json=fillOauthScope" json:"fill_oauth_scope,omitempty"` + // Whether server should return a given status + ResponseStatus *EchoStatus `protobuf:"bytes,7,opt,name=response_status,json=responseStatus" json:"response_status,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } func (m *SimpleRequest) String() string { return proto.CompactTextString(m) } func (*SimpleRequest) ProtoMessage() {} -func (*SimpleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +func (*SimpleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } func (m *SimpleRequest) GetResponseType() PayloadType { if m != nil && m.ResponseType != nil { @@ -176,6 +206,13 @@ func (m *SimpleRequest) GetFillOauthScope() bool { return false } +func (m *SimpleRequest) GetResponseStatus() *EchoStatus { + if m != nil { + return m.ResponseStatus + } + return nil +} + // Unary response, as configured by the request. type SimpleResponse struct { // Payload to increase message size. @@ -191,7 +228,7 @@ type SimpleResponse struct { func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } func (m *SimpleResponse) String() string { return proto.CompactTextString(m) } func (*SimpleResponse) ProtoMessage() {} -func (*SimpleResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } +func (*SimpleResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } func (m *SimpleResponse) GetPayload() *Payload { if m != nil { @@ -224,7 +261,7 @@ type StreamingInputCallRequest struct { func (m *StreamingInputCallRequest) Reset() { *m = StreamingInputCallRequest{} } func (m *StreamingInputCallRequest) String() string { return proto.CompactTextString(m) } func (*StreamingInputCallRequest) ProtoMessage() {} -func (*StreamingInputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } +func (*StreamingInputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } func (m *StreamingInputCallRequest) GetPayload() *Payload { if m != nil { @@ -243,7 +280,7 @@ type StreamingInputCallResponse struct { func (m *StreamingInputCallResponse) Reset() { *m = StreamingInputCallResponse{} } func (m *StreamingInputCallResponse) String() string { return proto.CompactTextString(m) } func (*StreamingInputCallResponse) ProtoMessage() {} -func (*StreamingInputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } +func (*StreamingInputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } func (m *StreamingInputCallResponse) GetAggregatedPayloadSize() int32 { if m != nil && m.AggregatedPayloadSize != nil { @@ -266,7 +303,7 @@ type ResponseParameters struct { func (m *ResponseParameters) Reset() { *m = ResponseParameters{} } func (m *ResponseParameters) String() string { return proto.CompactTextString(m) } func (*ResponseParameters) ProtoMessage() {} -func (*ResponseParameters) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } +func (*ResponseParameters) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } func (m *ResponseParameters) GetSize() int32 { if m != nil && m.Size != nil { @@ -292,14 +329,16 @@ type StreamingOutputCallRequest struct { // Configuration for each expected response message. ResponseParameters []*ResponseParameters `protobuf:"bytes,2,rep,name=response_parameters,json=responseParameters" json:"response_parameters,omitempty"` // Optional input payload sent along with the request. - Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` - XXX_unrecognized []byte `json:"-"` + Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` + // Whether server should return a given status + ResponseStatus *EchoStatus `protobuf:"bytes,7,opt,name=response_status,json=responseStatus" json:"response_status,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *StreamingOutputCallRequest) Reset() { *m = StreamingOutputCallRequest{} } func (m *StreamingOutputCallRequest) String() string { return proto.CompactTextString(m) } func (*StreamingOutputCallRequest) ProtoMessage() {} -func (*StreamingOutputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } +func (*StreamingOutputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } func (m *StreamingOutputCallRequest) GetResponseType() PayloadType { if m != nil && m.ResponseType != nil { @@ -322,6 +361,13 @@ func (m *StreamingOutputCallRequest) GetPayload() *Payload { return nil } +func (m *StreamingOutputCallRequest) GetResponseStatus() *EchoStatus { + if m != nil { + return m.ResponseStatus + } + return nil +} + // Server-streaming response, as configured by the request and parameters. type StreamingOutputCallResponse struct { // Payload to increase response size. @@ -332,7 +378,7 @@ type StreamingOutputCallResponse struct { func (m *StreamingOutputCallResponse) Reset() { *m = StreamingOutputCallResponse{} } func (m *StreamingOutputCallResponse) String() string { return proto.CompactTextString(m) } func (*StreamingOutputCallResponse) ProtoMessage() {} -func (*StreamingOutputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } +func (*StreamingOutputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } func (m *StreamingOutputCallResponse) GetPayload() *Payload { if m != nil { @@ -344,6 +390,7 @@ func (m *StreamingOutputCallResponse) GetPayload() *Payload { func init() { proto.RegisterType((*Empty)(nil), "grpc.testing.Empty") proto.RegisterType((*Payload)(nil), "grpc.testing.Payload") + proto.RegisterType((*EchoStatus)(nil), "grpc.testing.EchoStatus") proto.RegisterType((*SimpleRequest)(nil), "grpc.testing.SimpleRequest") proto.RegisterType((*SimpleResponse)(nil), "grpc.testing.SimpleResponse") proto.RegisterType((*StreamingInputCallRequest)(nil), "grpc.testing.StreamingInputCallRequest") @@ -748,41 +795,45 @@ var _TestService_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("test.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 567 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x54, 0x51, 0x6f, 0xd2, 0x50, - 0x14, 0xb6, 0x03, 0x64, 0x1c, 0x58, 0x43, 0x0e, 0x59, 0x64, 0x9d, 0x89, 0x4b, 0x7d, 0xb0, 0x9a, - 0x88, 0x86, 0x44, 0x1f, 0x35, 0x73, 0x63, 0x71, 0x09, 0x03, 0x6c, 0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af, 0xd7, 0xb3, 0xb7, 0x50, 0xcd, 0x04, 0xc6, - 0x3a, 0xd4, 0xce, 0xfa, 0x57, 0x03, 0xb3, 0x63, 0x59, 0xa7, 0xef, 0xba, 0x9d, 0xfa, 0x3d, 0xbe, - 0x08, 0x75, 0xd4, 0x5b, 0xc3, 0x14, 0x04, 0xb8, 0x6f, 0x9e, 0xf6, 0xce, 0xfb, 0x57, 0xf5, 0xbd, - 0xf6, 0x8f, 0x22, 0x54, 0x87, 0x5c, 0xdd, 0xe2, 0x4b, 0xb0, 0x27, 0x14, 0x5f, 0x41, 0x45, 0xfe, - 0x40, 0x84, 0x2d, 0x6c, 0xac, 0x4f, 0x97, 0x05, 0x2d, 0x0f, 0xc4, 0x0b, 0xa8, 0x8c, 0x5c, 0x12, - 0xc4, 0x6d, 0xc7, 0xeb, 0x8c, 0xb5, 0x1f, 0x87, 0xf6, 0x30, 0xbf, 0x98, 0x1c, 0x80, 0x03, 0x8d, - 0x9c, 0xf3, 0x41, 0x63, 0xa3, 0xe9, 0xc6, 0x4b, 0xa2, 0x3d, 0xdd, 0x81, 0x19, 0xcf, 0x7a, 0xa9, - 0xa0, 0x0d, 0xb8, 0xfd, 0x45, 0xe0, 0x93, 0x1b, 0x24, 0x36, 0xbf, 0x40, 0xcd, 0xf8, 0x33, 0x31, - 0x1e, 0x65, 0x88, 0x51, 0xea, 0x45, 0xe4, 0x38, 0xe7, 0x11, 0x4f, 0xfb, 0xf5, 0xbf, 0x65, 0x32, - 0x14, 0x99, 0x4a, 0x7d, 0x4f, 0x9c, 0xeb, 0x3b, 0x18, 0xf5, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x4c, - 0x41, 0xfe, 0xb6, 0x89, 0x06, 0x00, 0x00, + // 625 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x54, 0x4d, 0x6f, 0xd3, 0x4c, + 0x10, 0x7e, 0x9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b9, 0x9e, 0x49, 0xc8, 0x06, 0xb4, 0xfd, 0x51, 0xa1, 0x87, + 0x37, 0x48, 0x6c, 0x7e, 0xc4, 0xaa, 0xfe, 0x73, 0x62, 0x9c, 0x4a, 0xe7, 0xa9, 0xe4, 0xb3, 0xc8, + 0x71, 0x4e, 0x23, 0xe6, 0xf6, 0xd3, 0x5f, 0xf3, 0xa4, 0x4b, 0xc2, 0x95, 0xfc, 0x16, 0x3b, 0x57, + 0xff, 0x20, 0xd5, 0x8f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbb, 0x7f, 0x47, 0xd6, 0x4b, 0x07, 0x00, + 0x00, } diff --git a/interop/grpc_testing/test.proto b/interop/grpc_testing/test.proto index b5bfe053..d4ce2c1e 100644 --- a/interop/grpc_testing/test.proto +++ b/interop/grpc_testing/test.proto @@ -26,6 +26,13 @@ message Payload { optional bytes body = 2; } +// A protobuf representation for grpc status. This is used by test +// clients to specify a status that the server should attempt to return. +message EchoStatus { + optional int32 code = 1; + optional string message = 2; +} + // Unary request. message SimpleRequest { // Desired payload type in the response from the server. @@ -44,6 +51,9 @@ message SimpleRequest { // Whether SimpleResponse should include OAuth scope. optional bool fill_oauth_scope = 5; + + // Whether server should return a given status + optional EchoStatus response_status = 7; } // Unary response, as configured by the request. @@ -97,6 +107,9 @@ message StreamingOutputCallRequest { // Optional input payload sent along with the request. optional Payload payload = 3; + + // Whether server should return a given status + optional EchoStatus response_status = 7; } // Server-streaming response, as configured by the request and parameters. From d7ac54924b9433991f283957af1b7a9d462f7f86 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 30 Jun 2016 14:57:30 -0700 Subject: [PATCH 02/13] Add status_code_and_message interop test. (Does not yet work, because the server does not yet support the response_status field.) --- interop/client/client.go | 6 +++++- interop/test_utils.go | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/interop/client/client.go b/interop/client/client.go index 98f6cfec..9eb6f305 100644 --- a/interop/client/client.go +++ b/interop/client/client.go @@ -70,7 +70,8 @@ var ( per_rpc_creds: large_unary with per rpc token; oauth2_auth_token: large_unary with oauth2 token auth; cancel_after_begin: cancellation after metadata has been sent but before payloads are sent; - cancel_after_first_response: cancellation after receiving 1st message from the server.`) + cancel_after_first_response: cancellation after receiving 1st message from the server; + status_code_and_message: status code propagated back to client.`) // The test CA root cert file testCAFile = "testdata/ca.pem" @@ -180,6 +181,9 @@ func main() { case "cancel_after_first_response": interop.DoCancelAfterFirstResponse(tc) grpclog.Println("CancelAfterFirstResponse done") + case "status_code_and_message": + interop.DoStatusCodeAndMessage(tc) + grpclog.Println("StatusCodeAndMessage done") default: grpclog.Fatal("Unsupported test case: ", *testCase) } diff --git a/interop/test_utils.go b/interop/test_utils.go index 23340ab8..c9813ba5 100644 --- a/interop/test_utils.go +++ b/interop/test_utils.go @@ -454,6 +454,45 @@ func DoCancelAfterFirstResponse(tc testpb.TestServiceClient) { } } +// DoStatusCodeAndMessage checks that the status code is propagated back to the client. +func DoStatusCodeAndMessage(tc testpb.TestServiceClient) { + // Test UnaryCall. + var code int32 = 2 + msg := "test status message" + respStatus := &testpb.EchoStatus{ + Code: &code, + Message: &msg, + } + req := &testpb.SimpleRequest{ + ResponseStatus: respStatus, + } + _, err := tc.UnaryCall(context.Background(), req) + if grpc.Code(err) != 2 { + grpclog.Fatalf("/TestService/UnaryCall RPC compleled with error code %d, want %d", grpc.Code(err), code) + } + if err.Error() != msg { + grpclog.Fatal("/TestService/UnaryCall unexpected RPC error message: ", err) + } + // Test FullDuplexCall. + stream, err := tc.FullDuplexCall(context.Background()) + if err != nil { + grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) + } + stream_req := &testpb.StreamingOutputCallRequest{ + ResponseStatus: respStatus, + } + if err := stream.Send(stream_req); err != nil { + grpclog.Fatalf("%v.Send(%v) = %v", stream, stream_req, err) + } + err = stream.CloseSend() + if grpc.Code(err) != 2 { + grpclog.Fatalf("%v compleled with error code %d, want %d", stream, grpc.Code(err), code) + } + if err.Error() != msg { + grpclog.Fatalf("%v unexpected RPC error message: %v", stream, err) + } +} + type testServer struct { } From 84352c64004f17ecd3bfc4c75797c9051df6e079 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 1 Jul 2016 07:51:35 -0700 Subject: [PATCH 03/13] Change interop server to support response_status field. --- interop/test_utils.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/interop/test_utils.go b/interop/test_utils.go index c9813ba5..075e4813 100644 --- a/interop/test_utils.go +++ b/interop/test_utils.go @@ -456,9 +456,9 @@ func DoCancelAfterFirstResponse(tc testpb.TestServiceClient) { // DoStatusCodeAndMessage checks that the status code is propagated back to the client. func DoStatusCodeAndMessage(tc testpb.TestServiceClient) { + var code int32 = 2 + msg := "test status message" // Test UnaryCall. - var code int32 = 2 - msg := "test status message" respStatus := &testpb.EchoStatus{ Code: &code, Message: &msg, @@ -467,7 +467,7 @@ func DoStatusCodeAndMessage(tc testpb.TestServiceClient) { ResponseStatus: respStatus, } _, err := tc.UnaryCall(context.Background(), req) - if grpc.Code(err) != 2 { + if grpc.Code(err) != codes.Code(code) { grpclog.Fatalf("/TestService/UnaryCall RPC compleled with error code %d, want %d", grpc.Code(err), code) } if err.Error() != msg { @@ -485,7 +485,7 @@ func DoStatusCodeAndMessage(tc testpb.TestServiceClient) { grpclog.Fatalf("%v.Send(%v) = %v", stream, stream_req, err) } err = stream.CloseSend() - if grpc.Code(err) != 2 { + if grpc.Code(err) != codes.Code(code) { grpclog.Fatalf("%v compleled with error code %d, want %d", stream, grpc.Code(err), code) } if err.Error() != msg { @@ -524,6 +524,10 @@ func serverNewPayload(t testpb.PayloadType, size int32) (*testpb.Payload, error) } func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { + resp := in.GetResponseStatus() + if *resp.Code != 0 { + return nil, grpc.Errorf(codes.Code(*resp.Code), *resp.Message) + } pl, err := serverNewPayload(in.GetResponseType(), in.GetResponseSize()) if err != nil { return nil, err @@ -534,6 +538,10 @@ func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (* } func (s *testServer) StreamingOutputCall(args *testpb.StreamingOutputCallRequest, stream testpb.TestService_StreamingOutputCallServer) error { + resp := args.GetResponseStatus() + if *resp.Code != 0 { + return grpc.Errorf(codes.Code(*resp.Code), *resp.Message) + } cs := args.GetResponseParameters() for _, c := range cs { if us := c.GetIntervalUs(); us > 0 { From 0eec1573d071cc0a28422c48892227f882e0564e Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 1 Jul 2016 08:50:57 -0700 Subject: [PATCH 04/13] Fix NULL pointer dereference. --- interop/test_utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interop/test_utils.go b/interop/test_utils.go index 075e4813..c924b848 100644 --- a/interop/test_utils.go +++ b/interop/test_utils.go @@ -525,7 +525,7 @@ func serverNewPayload(t testpb.PayloadType, size int32) (*testpb.Payload, error) func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { resp := in.GetResponseStatus() - if *resp.Code != 0 { + if resp != nil && *resp.Code != 0 { return nil, grpc.Errorf(codes.Code(*resp.Code), *resp.Message) } pl, err := serverNewPayload(in.GetResponseType(), in.GetResponseSize()) @@ -539,7 +539,7 @@ func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (* func (s *testServer) StreamingOutputCall(args *testpb.StreamingOutputCallRequest, stream testpb.TestService_StreamingOutputCallServer) error { resp := args.GetResponseStatus() - if *resp.Code != 0 { + if resp != nil && *resp.Code != 0 { return grpc.Errorf(codes.Code(*resp.Code), *resp.Message) } cs := args.GetResponseParameters() From 7a971bb14219ae1accacd74a2577daf17c26c6ab Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 1 Jul 2016 09:04:20 -0700 Subject: [PATCH 05/13] Fix check for error string. --- interop/test_utils.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interop/test_utils.go b/interop/test_utils.go index c924b848..2b083528 100644 --- a/interop/test_utils.go +++ b/interop/test_utils.go @@ -458,11 +458,11 @@ func DoCancelAfterFirstResponse(tc testpb.TestServiceClient) { func DoStatusCodeAndMessage(tc testpb.TestServiceClient) { var code int32 = 2 msg := "test status message" - // Test UnaryCall. respStatus := &testpb.EchoStatus{ Code: &code, Message: &msg, } + // Test UnaryCall. req := &testpb.SimpleRequest{ ResponseStatus: respStatus, } @@ -470,7 +470,7 @@ func DoStatusCodeAndMessage(tc testpb.TestServiceClient) { if grpc.Code(err) != codes.Code(code) { grpclog.Fatalf("/TestService/UnaryCall RPC compleled with error code %d, want %d", grpc.Code(err), code) } - if err.Error() != msg { + if err.Error() != fmt.Sprint("rpc error: code = ", code, " desc = ", msg) { grpclog.Fatal("/TestService/UnaryCall unexpected RPC error message: ", err) } // Test FullDuplexCall. @@ -488,7 +488,7 @@ func DoStatusCodeAndMessage(tc testpb.TestServiceClient) { if grpc.Code(err) != codes.Code(code) { grpclog.Fatalf("%v compleled with error code %d, want %d", stream, grpc.Code(err), code) } - if err.Error() != msg { + if err.Error() != fmt.Sprint("rpc error: code = ", code, " desc = ", msg) { grpclog.Fatalf("%v unexpected RPC error message: %v", stream, err) } } From fa1bb7b8339d6671c3d56782228a97d1582c8646 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 1 Jul 2016 09:12:45 -0700 Subject: [PATCH 06/13] For FullDuplex() call, check error from stream.Recv() instead of stream.CloseSend(). --- interop/test_utils.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/interop/test_utils.go b/interop/test_utils.go index 2b083528..8275c43e 100644 --- a/interop/test_utils.go +++ b/interop/test_utils.go @@ -482,14 +482,18 @@ func DoStatusCodeAndMessage(tc testpb.TestServiceClient) { ResponseStatus: respStatus, } if err := stream.Send(stream_req); err != nil { - grpclog.Fatalf("%v.Send(%v) = %v", stream, stream_req, err) + grpclog.Fatalf("stream %v.Send(%v) = %v", stream, stream_req, err) } err = stream.CloseSend() + if err != nil { + grpclog.Fatalf("stream %v.CloseSend() = %v", stream, err) + } + _, err = stream.Recv() if grpc.Code(err) != codes.Code(code) { - grpclog.Fatalf("%v compleled with error code %d, want %d", stream, grpc.Code(err), code) + grpclog.Fatalf("stream %v compleled with error code %d, want %d", stream, grpc.Code(err), code) } if err.Error() != fmt.Sprint("rpc error: code = ", code, " desc = ", msg) { - grpclog.Fatalf("%v unexpected RPC error message: %v", stream, err) + grpclog.Fatalf("stream %v unexpected RPC error message: %v", stream, err) } } From f9584a00cf39f6c541853c135f45da74191bfdeb Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 1 Jul 2016 09:32:29 -0700 Subject: [PATCH 07/13] Move the server-side handling code from StreamingOutputCall to FullDuplexCall. --- interop/test_utils.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/interop/test_utils.go b/interop/test_utils.go index 8275c43e..d8ecccd3 100644 --- a/interop/test_utils.go +++ b/interop/test_utils.go @@ -542,10 +542,6 @@ func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (* } func (s *testServer) StreamingOutputCall(args *testpb.StreamingOutputCallRequest, stream testpb.TestService_StreamingOutputCallServer) error { - resp := args.GetResponseStatus() - if resp != nil && *resp.Code != 0 { - return grpc.Errorf(codes.Code(*resp.Code), *resp.Message) - } cs := args.GetResponseParameters() for _, c := range cs { if us := c.GetIntervalUs(); us > 0 { @@ -591,6 +587,10 @@ func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServ if err != nil { return err } + resp := in.GetResponseStatus() + if resp != nil && *resp.Code != 0 { + return grpc.Errorf(codes.Code(*resp.Code), *resp.Message) + } cs := in.GetResponseParameters() for _, c := range cs { if us := c.GetIntervalUs(); us > 0 { From de2db99c8473d5658abdd2eda6c487f82f6be00d Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 7 Jul 2016 07:39:32 -0700 Subject: [PATCH 08/13] Code review changes. --- interop/test_utils.go | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/interop/test_utils.go b/interop/test_utils.go index d8ecccd3..db642312 100644 --- a/interop/test_utils.go +++ b/interop/test_utils.go @@ -458,20 +458,17 @@ func DoCancelAfterFirstResponse(tc testpb.TestServiceClient) { func DoStatusCodeAndMessage(tc testpb.TestServiceClient) { var code int32 = 2 msg := "test status message" + expectedErr := grpc.Errorf(codes.Code(code), msg) respStatus := &testpb.EchoStatus{ - Code: &code, - Message: &msg, + Code: proto.Int32(code), + Message: proto.String(msg), } // Test UnaryCall. req := &testpb.SimpleRequest{ ResponseStatus: respStatus, } - _, err := tc.UnaryCall(context.Background(), req) - if grpc.Code(err) != codes.Code(code) { - grpclog.Fatalf("/TestService/UnaryCall RPC compleled with error code %d, want %d", grpc.Code(err), code) - } - if err.Error() != fmt.Sprint("rpc error: code = ", code, " desc = ", msg) { - grpclog.Fatal("/TestService/UnaryCall unexpected RPC error message: ", err) + if _, err := tc.UnaryCall(context.Background(), req); err.Error() != expectedErr.Error() { + grpclog.Fatalf("UnaryCall RPC returned error %v, want %v", err, expectedErr) } // Test FullDuplexCall. stream, err := tc.FullDuplexCall(context.Background()) @@ -484,16 +481,11 @@ func DoStatusCodeAndMessage(tc testpb.TestServiceClient) { if err := stream.Send(stream_req); err != nil { grpclog.Fatalf("stream %v.Send(%v) = %v", stream, stream_req, err) } - err = stream.CloseSend() - if err != nil { + if err := stream.CloseSend(); err != nil { grpclog.Fatalf("stream %v.CloseSend() = %v", stream, err) } - _, err = stream.Recv() - if grpc.Code(err) != codes.Code(code) { - grpclog.Fatalf("stream %v compleled with error code %d, want %d", stream, grpc.Code(err), code) - } - if err.Error() != fmt.Sprint("rpc error: code = ", code, " desc = ", msg) { - grpclog.Fatalf("stream %v unexpected RPC error message: %v", stream, err) + if _, err = stream.Recv(); err.Error() != expectedErr.Error() { + grpclog.Fatalf("stream %v.Recv() returned error %v, want %v", err, expectedErr) } } From 121344c9ee5d2294ffd32bc4ae43782e406a72d8 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 7 Jul 2016 11:32:46 -0700 Subject: [PATCH 09/13] Code review changes. --- interop/test_utils.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interop/test_utils.go b/interop/test_utils.go index db642312..71fc425b 100644 --- a/interop/test_utils.go +++ b/interop/test_utils.go @@ -473,16 +473,16 @@ func DoStatusCodeAndMessage(tc testpb.TestServiceClient) { // Test FullDuplexCall. stream, err := tc.FullDuplexCall(context.Background()) if err != nil { - grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) + grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) } stream_req := &testpb.StreamingOutputCallRequest{ ResponseStatus: respStatus, } if err := stream.Send(stream_req); err != nil { - grpclog.Fatalf("stream %v.Send(%v) = %v", stream, stream_req, err) + grpclog.Fatalf("stream %v.Send(%v) = %v, want ", stream, stream_req, err) } if err := stream.CloseSend(); err != nil { - grpclog.Fatalf("stream %v.CloseSend() = %v", stream, err) + grpclog.Fatalf("stream %v.CloseSend() = %v, want ", stream, err) } if _, err = stream.Recv(); err.Error() != expectedErr.Error() { grpclog.Fatalf("stream %v.Recv() returned error %v, want %v", err, expectedErr) From 44e75c33eeaa361651495280a68d921bc63c39ce Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 26 Aug 2016 12:59:51 -0700 Subject: [PATCH 10/13] Code review changes. --- interop/test_utils.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/interop/test_utils.go b/interop/test_utils.go index 71fc425b..7b76062a 100644 --- a/interop/test_utils.go +++ b/interop/test_utils.go @@ -458,7 +458,7 @@ func DoCancelAfterFirstResponse(tc testpb.TestServiceClient) { func DoStatusCodeAndMessage(tc testpb.TestServiceClient) { var code int32 = 2 msg := "test status message" - expectedErr := grpc.Errorf(codes.Code(code), msg) + expectedErr := grpc.Errorf(codes.Code(code), msg) respStatus := &testpb.EchoStatus{ Code: proto.Int32(code), Message: proto.String(msg), @@ -468,7 +468,7 @@ func DoStatusCodeAndMessage(tc testpb.TestServiceClient) { ResponseStatus: respStatus, } if _, err := tc.UnaryCall(context.Background(), req); err.Error() != expectedErr.Error() { - grpclog.Fatalf("UnaryCall RPC returned error %v, want %v", err, expectedErr) + grpclog.Fatalf("%v.UnaryCall(_, %v) = _, %v, want _, %v", tc, req, err, expectedErr) } // Test FullDuplexCall. stream, err := tc.FullDuplexCall(context.Background()) @@ -479,13 +479,13 @@ func DoStatusCodeAndMessage(tc testpb.TestServiceClient) { ResponseStatus: respStatus, } if err := stream.Send(stream_req); err != nil { - grpclog.Fatalf("stream %v.Send(%v) = %v, want ", stream, stream_req, err) + grpclog.Fatalf("%v.Send(%v) = %v, want ", stream, stream_req, err) } if err := stream.CloseSend(); err != nil { - grpclog.Fatalf("stream %v.CloseSend() = %v, want ", stream, err) + grpclog.Fatalf("%v.CloseSend() = %v, want ", stream, err) } if _, err = stream.Recv(); err.Error() != expectedErr.Error() { - grpclog.Fatalf("stream %v.Recv() returned error %v, want %v", err, expectedErr) + grpclog.Fatalf("%v.Recv() returned error %v, want %v", stream, err, expectedErr) } } From 23e20165e070534a7ab7fd28259833c3a325417f Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 28 Sep 2016 13:53:27 -0700 Subject: [PATCH 11/13] Code review changes. --- interop/test_utils.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/interop/test_utils.go b/interop/test_utils.go index 7b76062a..697b2156 100644 --- a/interop/test_utils.go +++ b/interop/test_utils.go @@ -520,9 +520,9 @@ func serverNewPayload(t testpb.PayloadType, size int32) (*testpb.Payload, error) } func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { - resp := in.GetResponseStatus() - if resp != nil && *resp.Code != 0 { - return nil, grpc.Errorf(codes.Code(*resp.Code), *resp.Message) + status := in.GetResponseStatus() + if status != nil && *status.Code != 0 { + return nil, grpc.Errorf(codes.Code(*status.Code), *status.Message) } pl, err := serverNewPayload(in.GetResponseType(), in.GetResponseSize()) if err != nil { @@ -579,9 +579,9 @@ func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServ if err != nil { return err } - resp := in.GetResponseStatus() - if resp != nil && *resp.Code != 0 { - return grpc.Errorf(codes.Code(*resp.Code), *resp.Message) + status := in.GetResponseStatus() + if status != nil && *status.Code != 0 { + return grpc.Errorf(codes.Code(*status.Code), *status.Message) } cs := in.GetResponseParameters() for _, c := range cs { From 5823568fcb6bd26a64dcff917ce397c01ae3fe8a Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 29 Sep 2016 07:24:20 -0700 Subject: [PATCH 12/13] Code review changes. --- interop/test_utils.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interop/test_utils.go b/interop/test_utils.go index 697b2156..15734471 100644 --- a/interop/test_utils.go +++ b/interop/test_utils.go @@ -475,11 +475,11 @@ func DoStatusCodeAndMessage(tc testpb.TestServiceClient) { if err != nil { grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v, want ", tc, err) } - stream_req := &testpb.StreamingOutputCallRequest{ + streamReq := &testpb.StreamingOutputCallRequest{ ResponseStatus: respStatus, } - if err := stream.Send(stream_req); err != nil { - grpclog.Fatalf("%v.Send(%v) = %v, want ", stream, stream_req, err) + if err := stream.Send(streamReq); err != nil { + grpclog.Fatalf("%v.Send(%v) = %v, want ", stream, streamReq, err) } if err := stream.CloseSend(); err != nil { grpclog.Fatalf("%v.CloseSend() = %v, want ", stream, err) From 951b6cc1da7c670edd5b687a4619ad56f245056d Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 30 Sep 2016 07:44:08 -0700 Subject: [PATCH 13/13] Code review changes. --- interop/test_utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interop/test_utils.go b/interop/test_utils.go index 15734471..908dd8dd 100644 --- a/interop/test_utils.go +++ b/interop/test_utils.go @@ -467,7 +467,7 @@ func DoStatusCodeAndMessage(tc testpb.TestServiceClient) { req := &testpb.SimpleRequest{ ResponseStatus: respStatus, } - if _, err := tc.UnaryCall(context.Background(), req); err.Error() != expectedErr.Error() { + if _, err := tc.UnaryCall(context.Background(), req); err == nil || err.Error() != expectedErr.Error() { grpclog.Fatalf("%v.UnaryCall(_, %v) = _, %v, want _, %v", tc, req, err, expectedErr) } // Test FullDuplexCall.