test: make request timeout test deterministic#814
Conversation
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
Greptile SummaryThis PR makes one request-admission timeout test deterministic. The main changes are:
|
| Filename | Overview |
|---|---|
| packages/data-designer-engine/tests/engine/models/request_admission/test_controller.py | Updates the expired-waiter async admission test to use a mocked controller clock instead of real timing. |
Reviews (2): Last reviewed commit: "Merge branch 'main' into andreatgretel/f..." | Re-trigger Greptile
|
Thanks for tackling this flake, @andreatgretel — trading wall-clock timing for a controlled clock is exactly the right move here. SummaryThis test-only change makes FindingsSuggestions — Take it or leave it
What Looks Good
Structural Impact(graphify, 2.5s) Risk: LOW (localized change)
VerdictShip it (with nits) — Solid, well-scoped determinism fix with coverage intact. The only note is an optional consistency suggestion to match the narrower Note: This review was generated by an AI assistant. |
johnnygreco
left a comment
There was a problem hiding this comment.
Thanks for tightening this up, @andreatgretel!
Summary
This replaces wall-clock sleeps and thread scheduling in the expired-waiter regression test with a controller-local fake monotonic clock, then advances that clock before releasing capacity. The implementation matches the PR's stated intent and preserves coverage that the expired waiter receives queue_timeout without retaining waiter or capacity state.
Findings
No findings.
What Looks Good
- Replacing the controller module's
timebinding withSimpleNamespacekeeps clock control isolated to the controller and avoids freezing asyncio's own monotonic clock. - The test verifies that the waiter is actually queued before advancing time, then checks the timeout reason and all relevant cleanup counters afterward.
- Removing the helper thread and real sleeps makes the scenario substantially faster and eliminates the scheduling sensitivity that caused the flake.
Verdict
Ship it — Ready to merge as-is.
This review was generated by an AI assistant.
📋 Summary
Makes the expired request-admission waiter test deterministic by controlling the clock used by the controller. The existing wall-clock timing failed intermittently in unrelated PR #812 and PR #813, while equivalent checks also passed on main and other PR runs.
🔗 Related Issue
N/A. Flakes observed on PR #812 and PR #813.
🔄 Changes
🧪 Testing
make testpasses (not run; the full engine suite passed).venv/bin/ruff check --fix ..venv/bin/ruff format ..venv/bin/pytest -p no:cacheprovider packages/data-designer-engine/tests/engine/models/request_admission/test_controller.py(25 passed).venv/bin/pytest -p no:cacheprovider packages/data-designer-engine/tests(2,209 passed)✅ Checklist