From e898366de4fc90164d53d55aafb756db1ac182c8 Mon Sep 17 00:00:00 2001 From: Lee Hannigan <29015211+LeeroyHannigan@users.noreply.github.com> Date: Sat, 14 Nov 2026 17:46:22 +0000 Subject: [PATCH] test(backup): accept a DELETING restore target while the cell waits for it to go _wait_table_gone failed on any status other than CREATING. On PostgreSQL, abort_restore sets a failed restore's target to DELETING before it drops the data and deletes the row. A DescribeTable poll in that window failed test_a_tampered_data_file_fails_the_restore_before_any_item in run 43619460425. The helper now accepts CREATING and DELETING. Neither status is writable, and the assertion checks that the target never became writable. Fixes #993 --- tests/test_backup_job.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_backup_job.py b/tests/test_backup_job.py index 7fb1dc85b..17ad0b7e0 100644 --- a/tests/test_backup_job.py +++ b/tests/test_backup_job.py @@ -964,7 +964,10 @@ def _wait_table_gone(ddb, name: str, timeout: float = 120.0) -> None: except ClientError as e: assert e.response["Error"]["Code"] == "ResourceNotFoundException", e.response["Error"] return - assert status == "CREATING", f"{name} is {status}, it was never writable" + # The removal of a failed restore's target can pass through DELETING + # (PostgreSQL's abort_restore sets it before the drop), so a poll can + # see either status. Neither is writable. + assert status in ("CREATING", "DELETING"), f"{name} is {status}, it was never writable" time.sleep(0.2) raise AssertionError(f"{name} still exists after {timeout} s")