Poll DescribeTable until the table no longer exists.
(client, table_name: str, timeout: float = 300.0)
| 134 | # Wait for the table to be fully removed. |
| 135 | wait_for_deleted(dynamodb_client, name) |
| 136 | def wait_for_deleted(client, table_name: str, timeout: float = 300.0) -> None: |
| 137 | """Poll DescribeTable until the table no longer exists.""" |
| 138 | interval = _poll_interval() |
| 139 | deadline = time.monotonic() + timeout |
| 140 | while time.monotonic() < deadline: |
| 141 | try: |
| 142 | client.describe_table(TableName=table_name) |
| 143 | except client.exceptions.ResourceNotFoundException: |
| 144 | return |
| 145 | time.sleep(interval) |
| 146 | raise TimeoutError(f"Table {table_name} was not deleted within {timeout}s") |
| 147 | |
| 148 | |
| 149 | from contextlib import contextmanager |
no test coverage detected