aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio_tests/tests/stress/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/python/grpcio_tests/tests/stress/client.py')
-rw-r--r--src/python/grpcio_tests/tests/stress/client.py9
1 files changed, 6 insertions, 3 deletions
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)