From 387c9c0be3198e23139a6d20d20694517851f50c Mon Sep 17 00:00:00 2001 From: Lidi Zheng Date: Tue, 7 Jan 2020 16:34:05 -0800 Subject: [PATCH] Improve the credibility of the test --- .../grpcio_tests/tests_aio/unit/channel_argument_test.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/python/grpcio_tests/tests_aio/unit/channel_argument_test.py b/src/python/grpcio_tests/tests_aio/unit/channel_argument_test.py index 934085d8ba2..99e55dc6b2a 100644 --- a/src/python/grpcio_tests/tests_aio/unit/channel_argument_test.py +++ b/src/python/grpcio_tests/tests_aio/unit/channel_argument_test.py @@ -93,7 +93,7 @@ class TestChannelArgument(AioTestBase): random.seed(_RANDOM_SEED) async def test_server_so_reuse_port_is_set_properly(self): - for _ in range(_NUM_SERVER_CREATED): + async def test_body(): fact, options = random.choice(_OPTIONS) server = aio.server(options=options) try: @@ -109,6 +109,11 @@ class TestChannelArgument(AioTestBase): finally: await server.stop(None) + # Creating a lot of servers concurrently + await asyncio.gather( + *(test_body() for _ in range(_NUM_SERVER_CREATED)) + ) + async def test_client(self): aio.insecure_channel('[::]:0', options=_TEST_CHANNEL_ARGS)