From 3521a45f0adeff6310ad5e49d9a145d40661bf06 Mon Sep 17 00:00:00 2001 From: Oleksandr Havryliak Date: Wed, 18 Sep 2024 11:16:05 +0300 Subject: [PATCH] PBM fix for the tests with external backup --- pbm-functional/pytest/cluster.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pbm-functional/pytest/cluster.py b/pbm-functional/pytest/cluster.py index 59486c22..d781c219 100644 --- a/pbm-functional/pytest/cluster.py +++ b/pbm-functional/pytest/cluster.py @@ -852,10 +852,19 @@ def external_backup_copy(self, name): def external_backup_finish(self, name): n = testinfra.get_host("docker://" + self.pbm_cli) - result = n.check_output("pbm backup-finish " + name + " -o json") + result = n.check_output("pbm backup-finish " + name) Cluster.log("External backup finished: " + result) def external_restore_start(self): + timeout = time.time() + 60 + while True: + if not self.get_status()['running']: + break + if time.time() > timeout: + assert False, "Cannot start restore, another operation running: " + self.get_status()['running'] + time.sleep(1) + Cluster.log("Restore started") + if self.layout == "sharded": client = pymongo.MongoClient(self.connection) result = client.admin.command("balancerStop")