From ed2a5740d144cea551ff625e373232c795f47180 Mon Sep 17 00:00:00 2001 From: Marcelo Henrique Neppel Date: Fri, 21 Jun 2024 17:30:44 -0300 Subject: [PATCH] Retry on sync-standby change check Signed-off-by: Marcelo Henrique Neppel --- tests/integration/ha_tests/test_async_replication.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/integration/ha_tests/test_async_replication.py b/tests/integration/ha_tests/test_async_replication.py index 96bdb3afa4..ccae617ac8 100644 --- a/tests/integration/ha_tests/test_async_replication.py +++ b/tests/integration/ha_tests/test_async_replication.py @@ -438,9 +438,11 @@ async def test_async_replication_failover_in_main_cluster( ) # Check that the sync-standby unit is not the same as before. - new_sync_standby = await get_sync_standby(ops_test, first_model, DATABASE_APP_NAME) - logger.info(f"New sync-standby: {new_sync_standby}") - assert new_sync_standby != sync_standby, "Sync-standby is the same as before" + for attempt in Retrying(stop=stop_after_delay(90), wait=wait_fixed(10), reraise=True): + with attempt: + new_sync_standby = await get_sync_standby(ops_test, first_model, DATABASE_APP_NAME) + logger.info(f"New sync-standby: {new_sync_standby}") + assert new_sync_standby != sync_standby, "Sync-standby is the same as before" logger.info("Ensure continuous_writes after the crashed unit") await are_writes_increasing(ops_test)