summaryrefslogtreecommitdiff
path: root/tests/test_asyncio/test_cluster.py
diff options
context:
space:
mode:
authorUtkarsh Gupta <utkarshgupta137@gmail.com>2022-06-19 07:16:02 +0530
committerGitHub <noreply@github.com>2022-06-19 04:46:02 +0300
commit33702983b8b0a55d29189babb631ea108ee8404f (patch)
tree3ddc0aeb574b0cf1f7c665b32d74a92c1377ba5b /tests/test_asyncio/test_cluster.py
parent2ee61f0b5c54df54ebfc382eea2661d709ce9c73 (diff)
downloadredis-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.py8
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