From 1227376b8a5ecbd5e8a6e444f017644deace4585 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Tue, 10 Feb 2026 15:29:05 +0100 Subject: [PATCH 1/2] workaround: give the cluster time to restore the hot backup --- tests/test_backup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_backup.py b/tests/test_backup.py index 1fea7ecd..12de2791 100644 --- a/tests/test_backup.py +++ b/tests/test_backup.py @@ -1,6 +1,7 @@ import time import pytest +import time from packaging import version from arango.errno import DATABASE_NOT_FOUND, FILE_NOT_FOUND, FORBIDDEN, HTTP_NOT_FOUND @@ -110,6 +111,7 @@ def test_backup_management(sys_db, bad_db, cluster, skip_tests, db_version): # Test restore backup. result = sys_db.backup.restore(backup_id_foo) + time.sleep(10) assert isinstance(result, dict) # Wait for restore to complete From 8ffdefc62c62fb0c30298e77a3d75e6f260eb9cb Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Thu, 26 Feb 2026 15:23:08 +0100 Subject: [PATCH 2/2] implement waiting for cluster resillience after hotbackup restore --- tests/test_backup.py | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/tests/test_backup.py b/tests/test_backup.py index 12de2791..b42c93ae 100644 --- a/tests/test_backup.py +++ b/tests/test_backup.py @@ -15,6 +15,41 @@ ) from tests.helpers import assert_raises +def wait_for_cluster_resilient(sys_db): + firstExec = True + collectionsInSync = True + attempts = 100 + while not collectionsInSync and attempts > 0: + collectionsInSync = True + countInSync = 0 + countStillWaiting = 0 + cols = sys_db.replication.cluster_inventory(include_system=True) + print(cols) + if cols is None: + collectionsInSync = False + time.sleep(1) + attempts -= 1 + continue + for col in cols: + collectionsInSync = collectionsInSync and col.allInSync + if not col.allInSync: + countStillWaiting += 1 + else: + countInSync+= 1 + + if not collectionsInSync: + time.sleep(1) + if attempts % 50 == 0: + print(cols) + print(f"Amount of collection in sync: {countInSync}. Still not in sync: {countStillWaiting}") + if firstExec: + firstExec = False + if countInSync + countStillWaiting > 100: + attempts = Math.round((countInSync + countStillWaiting) * 0.8); + print("Set attempts to {attempts}") + attempts -= 1; + if attempts == 0: + raise Exception("collections didn't come in sync!") def test_backup_management(sys_db, bad_db, cluster, skip_tests, db_version): if "enterprise" in skip_tests: @@ -111,11 +146,13 @@ def test_backup_management(sys_db, bad_db, cluster, skip_tests, db_version): # Test restore backup. result = sys_db.backup.restore(backup_id_foo) - time.sleep(10) assert isinstance(result, dict) # Wait for restore to complete - time.sleep(10) + if cluster: + wait_for_cluster_resilient(sys_db) + else: + time.sleep(10) # Test restore backup with bad database. with assert_raises(BackupRestoreError) as err: