diff options
author | ncteisen <ncteisen@gmail.com> | 2017-01-18 17:06:24 -0800 |
---|---|---|
committer | ncteisen <ncteisen@gmail.com> | 2017-01-19 11:41:25 -0800 |
commit | af2c01e73e265265c6e30aa2fef5f9768f6a1d9f (patch) | |
tree | 8d4bdb07d170ecf8926f23fa68b548e3824f2b0a | |
parent | 6da1dc87aa3384594e9ab6218b1e0886573108de (diff) |
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.
-rw-r--r-- | src/python/grpcio_tests/tests/http2/negative_http2_client.py (renamed from src/python/grpcio_tests/tests/http2/_negative_http2_client.py) | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/python/grpcio_tests/tests/http2/_negative_http2_client.py b/src/python/grpcio_tests/tests/http2/negative_http2_client.py index c192d827c4..b8adf093a5 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) |