MCPcopy Create free account
hub / github.com/ExtendDB/extenddb / wait_for_deleted

Function wait_for_deleted

tests/conftest.py:136–146  ·  view source on GitHub ↗

Poll DescribeTable until the table no longer exists.

(client, table_name: str, timeout: float = 300.0)

Source from the content-addressed store, hash-verified

134 # Wait for the table to be fully removed.
135 wait_for_deleted(dynamodb_client, name)
136def 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
149from contextlib import contextmanager

Calls 2

_poll_intervalFunction · 0.85
describe_tableMethod · 0.80

Tested by

no test coverage detected