From af2c01e73e265265c6e30aa2fef5f9768f6a1d9f Mon Sep 17 00:00:00 2001 From: ncteisen Date: Wed, 18 Jan 2017 17:06:24 -0800 Subject: [PATCH] Expect INTERNAL in Python negative interop client The test now expects to receive StatusCode.INTERNAL when it receives a RST_STREAM from the server in order to comply with https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md Also added wait for ready behavior on the client channel. --- ...ative_http2_client.py => negative_http2_client.py} | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) rename src/python/grpcio_tests/tests/http2/{_negative_http2_client.py => negative_http2_client.py} (94%) diff --git a/src/python/grpcio_tests/tests/http2/_negative_http2_client.py b/src/python/grpcio_tests/tests/http2/negative_http2_client.py similarity index 94% rename from src/python/grpcio_tests/tests/http2/_negative_http2_client.py rename to src/python/grpcio_tests/tests/http2/negative_http2_client.py index c192d827c40..b8adf093a56 100644 --- a/src/python/grpcio_tests/tests/http2/_negative_http2_client.py +++ b/src/python/grpcio_tests/tests/http2/negative_http2_client.py @@ -82,20 +82,22 @@ def _goaway(stub): def _rst_after_header(stub): resp_future = stub.UnaryCall.future(_SIMPLE_REQUEST) - _validate_status_code_and_details(resp_future, grpc.StatusCode.UNAVAILABLE, - "") + _validate_status_code_and_details(resp_future, grpc.StatusCode.INTERNAL, + "Received RST_STREAM with error code 0") def _rst_during_data(stub): resp_future = stub.UnaryCall.future(_SIMPLE_REQUEST) - _validate_status_code_and_details(resp_future, grpc.StatusCode.UNKNOWN, "") + _validate_status_code_and_details(resp_future, grpc.StatusCode.INTERNAL, + "Received RST_STREAM with error code 0") def _rst_after_data(stub): resp_future = stub.UnaryCall.future(_SIMPLE_REQUEST) _validate_payload_type_and_length( next(resp_future), messages_pb2.COMPRESSABLE, _RESPONSE_SIZE) - _validate_status_code_and_details(resp_future, grpc.StatusCode.UNKNOWN, "") + _validate_status_code_and_details(resp_future, grpc.StatusCode.INTERNAL, + "Received RST_STREAM with error code 0") def _ping(stub): @@ -159,6 +161,7 @@ def _args(): def _stub(server_host, server_port): target = '{}:{}'.format(server_host, server_port) channel = grpc.insecure_channel(target) + grpc.channel_ready_future(channel).result() return test_pb2.TestServiceStub(channel)