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

Function wait_for_active

tests/conftest.py:80–92  ·  view source on GitHub ↗

Poll DescribeTable until status is ACTIVE. Shared helper — import from conftest instead of duplicating per-module.

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

Source from the content-addressed store, hash-verified

78
79
80def wait_for_active(client, table_name: str, timeout: float = 120.0) -> None:
81 """Poll DescribeTable until status is ACTIVE.
82
83 Shared helper — import from conftest instead of duplicating per-module.
84 """
85 interval = _poll_interval()
86 deadline = time.monotonic() + timeout
87 while time.monotonic() < deadline:
88 resp = client.describe_table(TableName=table_name)
89 if resp["Table"]["TableStatus"] == "ACTIVE":
90 return
91 time.sleep(interval)
92 raise TimeoutError(f"Table {table_name} did not become ACTIVE within {timeout}s")
93@pytest.fixture()
94def create_and_cleanup_table(dynamodb_client, unique_table_name):
95 """Create a table and ensure it's deleted after the test (REQ-TEST-005)."""

Calls 2

_poll_intervalFunction · 0.85
describe_tableMethod · 0.80

Tested by

no test coverage detected