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.
pull/9348/head
ncteisen 8 years ago
parent 6da1dc87aa
commit af2c01e73e
  1. 11
      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)
Loading…
Cancel
Save