From 7c6e49ee37bbf74b3d626d4deb1caf65100d446b Mon Sep 17 00:00:00 2001 From: kostas Date: Fri, 4 Apr 2025 12:49:13 +0300 Subject: [PATCH 1/2] fix: take_over_counters Signed-off-by: kostas --- tests/dragonfly/replication_test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/dragonfly/replication_test.py b/tests/dragonfly/replication_test.py index 9e78df5f43c0..17a8dbf3f9b1 100644 --- a/tests/dragonfly/replication_test.py +++ b/tests/dragonfly/replication_test.py @@ -1246,7 +1246,10 @@ async def block_during_takeover(): "Add a blocking command during takeover to make sure it doesn't block it." start = time.time() # The command should just be canceled - assert await c_blocking.execute_command("BLPOP BLOCKING_KEY1 BLOCKING_KEY2 100") is None + try: + assert await c_blocking.execute_command("BLPOP BLOCKING_KEY1 BLOCKING_KEY2 100") is None + except redis.exceptions.ConnectionError as e: + pass # And it should happen in reasonable amount of time. assert time.time() - start < 10 From dd77b6a3c5541cb0fa9b0b2302783dc0bf6633a5 Mon Sep 17 00:00:00 2001 From: kostas Date: Tue, 8 Apr 2025 14:31:56 +0300 Subject: [PATCH 2/2] increase delay for takeover --- tests/dragonfly/replication_test.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/dragonfly/replication_test.py b/tests/dragonfly/replication_test.py index 17a8dbf3f9b1..cc1e0c116a0d 100644 --- a/tests/dragonfly/replication_test.py +++ b/tests/dragonfly/replication_test.py @@ -1246,15 +1246,12 @@ async def block_during_takeover(): "Add a blocking command during takeover to make sure it doesn't block it." start = time.time() # The command should just be canceled - try: - assert await c_blocking.execute_command("BLPOP BLOCKING_KEY1 BLOCKING_KEY2 100") is None - except redis.exceptions.ConnectionError as e: - pass + assert await c_blocking.execute_command("BLPOP BLOCKING_KEY1 BLOCKING_KEY2 100") is None # And it should happen in reasonable amount of time. assert time.time() - start < 10 async def delayed_takeover(): - await asyncio.sleep(0.3) + await asyncio.sleep(1) await c1.execute_command(f"REPLTAKEOVER 5") _, _, *results = await asyncio.gather(