diff options
author | Utkarsh Gupta <utkarshgupta137@gmail.com> | 2022-06-19 07:16:02 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-19 04:46:02 +0300 |
commit | 33702983b8b0a55d29189babb631ea108ee8404f (patch) | |
tree | 3ddc0aeb574b0cf1f7c665b32d74a92c1377ba5b /tests/test_asyncio/test_cluster.py | |
parent | 2ee61f0b5c54df54ebfc382eea2661d709ce9c73 (diff) | |
download | redis-py-33702983b8b0a55d29189babb631ea108ee8404f.tar.gz |
async_cluster: fix simultaneous initialize (#2231)
- close startup_nodes too during client.close(), in case they are different
Diffstat (limited to 'tests/test_asyncio/test_cluster.py')
-rw-r--r-- | tests/test_asyncio/test_cluster.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_asyncio/test_cluster.py b/tests/test_asyncio/test_cluster.py index 0c676cb..e5ec026 100644 --- a/tests/test_asyncio/test_cluster.py +++ b/tests/test_asyncio/test_cluster.py @@ -680,13 +680,15 @@ class TestRedisClusterObj: else: raise e - async def test_can_run_concurrent_commands(self, r: RedisCluster) -> None: - assert await r.ping(target_nodes=RedisCluster.ALL_NODES) is True + async def test_can_run_concurrent_commands(self, request: FixtureRequest) -> None: + url = request.config.getoption("--redis-url") + rc = RedisCluster.from_url(url) assert all( await asyncio.gather( - *(r.ping(target_nodes=RedisCluster.ALL_NODES) for _ in range(100)) + *(rc.echo("i", target_nodes=RedisCluster.ALL_NODES) for i in range(100)) ) ) + await rc.close() @pytest.mark.onlycluster |