From fdef8d28bdfe99674425ca964299a8396041d915 Mon Sep 17 00:00:00 2001 From: Roger Yao Date: Fri, 22 Mar 2024 09:37:55 +0800 Subject: [PATCH] test: fix flaky test case test_ha_backup_deletion_recovery address the backup volume might not have been created yet longhorn/longhorn#8231 Signed-off-by: Roger Yao --- manager/integration/tests/common.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manager/integration/tests/common.py b/manager/integration/tests/common.py index 133d14bada..3cba7e5956 100644 --- a/manager/integration/tests/common.py +++ b/manager/integration/tests/common.py @@ -3129,10 +3129,10 @@ def wait_for_backup_volume_backing_image_synced( completed = False for _ in range(retry_count): bv = find_backup_volume(client, volume_name) - assert bv is not None - if bv.backingImageName == backing_image: - completed = True - break + if bv is not None: + if bv.backingImageName == backing_image: + completed = True + break time.sleep(RETRY_BACKUP_INTERVAL) assert completed is True, f" Backup Volume = {bv}," \ f" Backing Image = {backing_image}," \