Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/testing/TEST_FORMAT.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Use `execute_command_until()` only for state the server may publish asynchronous

- The predicate checks that the state is present (for example, the counter is non-zero), not the value the test asserts. The assertion still judges the result.
- Errors are never retried. An error result is returned at once.
- On timeout, the last result is returned so the assertion reports it.
- On timeout (20 seconds by default), the last result is returned so the assertion reports it.

```python
# ✅ Good: wait until the counter is published, then assert on it
Expand Down
7 changes: 6 additions & 1 deletion documentdb_tests/framework/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def execute_command_until(
command: Dict,
done: Callable[[Dict], bool],
*,
timeout: float = 10.0,
timeout: float = 20.0,
interval: float = 0.1,
) -> Any:
"""
Expand All @@ -148,6 +148,11 @@ def execute_command_until(
timeout, the last result is returned as-is so the caller's assertion
reports it.

The 20-second default is twice the roughly 10-second cycle on which some
engines publish usage counters, so a busy server still reports them
before the deadline. Polling ends as soon as ``done`` accepts a
result, so the timeout only costs time when the state never appears.

Args:
collection: DocumentDB collection
command: Command to execute via runCommand
Expand Down
Loading