Skip to content

Commit c9dcf25

Browse files
authored
test: fix shutdown_test by waiting for server to be ready after restart (#5930)
1 parent fd5a3c7 commit c9dcf25

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/dragonfly/shutdown_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from pathlib import Path
66

77
from . import dfly_args
8+
from .utility import wait_available_async
89

910
BASIC_ARGS = {"dir": "{DRAGONFLY_TMP}/"}
1011

@@ -104,6 +105,7 @@ async def test_shutdown_safe_persists_snapshot(self, df_factory, tmp_path):
104105
# Restart and verify data persisted
105106
df_server.start()
106107
client = aioredis.Redis(port=df_server.port)
108+
await wait_available_async(client)
107109
val = await client.get("safe_key")
108110
assert val == b"safe_value"
109111
await client.connection_pool.disconnect()
@@ -130,6 +132,7 @@ async def test_shutdown_save_persists_snapshot(self, df_factory, tmp_path):
130132

131133
df_server.start()
132134
client = aioredis.Redis(port=df_server.port)
135+
await wait_available_async(client)
133136
val = await client.get("save_key")
134137
assert val == b"save_value"
135138
await client.connection_pool.disconnect()

0 commit comments

Comments
 (0)