diff options
author | Mark D. Roth <roth@google.com> | 2017-01-13 11:23:01 -0800 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2017-01-13 11:23:01 -0800 |
commit | e6bcd0ebc9c35581b5459d9cc186dd71a2d701c9 (patch) | |
tree | 9b273b5a4cf19be2c83fdff232fd9dc5e36b4f45 /src/python/grpcio_tests/tests | |
parent | c17ed124eca8fc6bed31c6e0d192fde386bdb3c2 (diff) | |
parent | 6b6954050cf0379dbbee90dd18313a3779e0dd52 (diff) |
Merge remote-tracking branch 'upstream/master' into revert-9063-revert-8951-revert-8949-revert-8922-slice_cleanup
Diffstat (limited to 'src/python/grpcio_tests/tests')
-rw-r--r-- | src/python/grpcio_tests/tests/qps/benchmark_client.py | 8 | ||||
-rw-r--r-- | src/python/grpcio_tests/tests/stress/client.py | 9 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/python/grpcio_tests/tests/qps/benchmark_client.py b/src/python/grpcio_tests/tests/qps/benchmark_client.py index 83b46c914e..650e4756e7 100644 --- a/src/python/grpcio_tests/tests/qps/benchmark_client.py +++ b/src/python/grpcio_tests/tests/qps/benchmark_client.py @@ -68,12 +68,8 @@ class BenchmarkClient: else: channel = grpc.insecure_channel(server) - connected_event = threading.Event() - def wait_for_ready(connectivity): - if connectivity == grpc.ChannelConnectivity.READY: - connected_event.set() - channel.subscribe(wait_for_ready, try_to_connect=True) - connected_event.wait() + # waits for the channel to be ready before we start sending messages + grpc.channel_ready_future(channel).result() if config.payload_config.WhichOneof('payload') == 'simple_params': self._generic = False diff --git a/src/python/grpcio_tests/tests/stress/client.py b/src/python/grpcio_tests/tests/stress/client.py index 390ea13021..b8116729b5 100644 --- a/src/python/grpcio_tests/tests/stress/client.py +++ b/src/python/grpcio_tests/tests/stress/client.py @@ -110,10 +110,13 @@ def _get_channel(target, args): channel_credentials = grpc.ssl_channel_credentials( root_certificates=root_certificates) options = (('grpc.ssl_target_name_override', args.server_host_override,),) - return grpc.secure_channel( - target, channel_credentials, options=options) + channel = grpc.secure_channel(target, channel_credentials, options=options) else: - return grpc.insecure_channel(target) + channel = grpc.insecure_channel(target) + + # waits for the channel to be ready before we start sending messages + grpc.channel_ready_future(channel).result() + return channel def run_test(args): test_cases = _parse_weighted_test_cases(args.test_cases) |