Skip to content

Commit ee89983

Browse files
Tim Lanetilne
authored andcommitted
Handle "TRANSFERRING" state when waiting for FSx backup
When the FSx backup feature was launched backups remained in the "CREATING" state (as per the "Lifecycle" attribute from the output of the DescribeBackups API) until the attempted backup creation was finished. In order to address a bug, an additional "TRANSFERRING" state was added. Thus, a successfully created backup is expected to pass through the "CREATING" and then "TRANSFERRING" states. Where before the FSx backup test assumed any state other than "CREATING" meant backup creation had finished, this change enables the polling functions to wait until its no longer in the "TRANSFERRING" state. Signed-off-by: Tim Lane <[email protected]>
1 parent 6f0f53f commit ee89983

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/integration-tests/tests/storage/test_fsx_lustre.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
from tests.common.schedulers_common import SgeCommands
2525

26+
BACKUP_NOT_YET_AVAILABLE_STATES = {"CREATING", "TRANSFERRING"}
27+
2628

2729
@pytest.mark.parametrize(
2830
"deployment_type, per_unit_storage_throughput", [("PERSISTENT_1", 200), ("SCRATCH_1", None), ("SCRATCH_2", None)]
@@ -304,7 +306,7 @@ def monitor_automatic_backup_creation(remote_command_executor, fsx_fs_id, region
304306

305307

306308
@retry(
307-
retry_on_result=lambda result: result.get("Lifecycle") in ["CREATING", "NOT_STARTED"],
309+
retry_on_result=lambda result: result.get("Lifecycle") in BACKUP_NOT_YET_AVAILABLE_STATES | {"NOT_STARTED"},
308310
wait_fixed=seconds(5),
309311
stop_max_delay=minutes(7),
310312
)
@@ -337,7 +339,7 @@ def create_manual_fs_backup(remote_command_executor, fsx_fs_id, region):
337339

338340

339341
@retry(
340-
retry_on_result=lambda result: result.get("Lifecycle") in ["CREATING"],
342+
retry_on_result=lambda result: result.get("Lifecycle") in BACKUP_NOT_YET_AVAILABLE_STATES,
341343
wait_fixed=seconds(5),
342344
stop_max_delay=minutes(7),
343345
)

0 commit comments

Comments
 (0)