mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 18:35:46 +02:00
fix(test): Verify that save has not finished (#3278)
fix(test): Verify that save has not finished, otherwise it's an endless loop
This commit is contained in:
parent
775ba34223
commit
daa7e3708c
1 changed files with 9 additions and 3 deletions
|
@ -2070,7 +2070,10 @@ async def test_saving_replica(df_factory):
|
|||
|
||||
save_task = asyncio.create_task(save_replica())
|
||||
while not await is_saving(c_replica): # wait for replica start saving
|
||||
asyncio.sleep(0.1)
|
||||
assert "rdb_changes_since_last_success_save:0" not in await c_replica.execute_command(
|
||||
"info persistence"
|
||||
), "Weak test case, finished saving too quickly"
|
||||
await asyncio.sleep(0.1)
|
||||
await c_replica.execute_command("replicaof no one")
|
||||
assert await is_saving(c_replica)
|
||||
await save_task
|
||||
|
@ -2090,14 +2093,17 @@ async def test_start_replicating_while_save(df_factory):
|
|||
c_master = master.client()
|
||||
c_replica = replica.client()
|
||||
|
||||
await c_replica.execute_command("DEBUG POPULATE 1000 key 4096 RAND")
|
||||
await c_replica.execute_command("DEBUG POPULATE 10000 key 4096 RAND")
|
||||
|
||||
async def save_replica():
|
||||
await c_replica.execute_command("save")
|
||||
|
||||
save_task = asyncio.create_task(save_replica())
|
||||
while not await is_saving(c_replica): # wait for server start saving
|
||||
asyncio.sleep(0.1)
|
||||
assert "rdb_changes_since_last_success_save:0" not in await c_replica.execute_command(
|
||||
"info persistence"
|
||||
), "Weak test case, finished saving too quickly"
|
||||
await asyncio.sleep(0.1)
|
||||
await c_replica.execute_command(f"REPLICAOF localhost {master.port}")
|
||||
assert await is_saving(c_replica)
|
||||
await save_task
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue