Repository navigation
Conversation
The fake leg delays and request budget share a private event loop clock. Preserve the original timing inputs and assertions, and require blocked legs to time out and cancel. Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4 of 5 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #998
Changelog category (leave one):
Changelog entry
Not required.
Why
The first-content-leg unit case expects a fake lexical read to finish after 300 ms inside a 400 ms request budget. The budget starts before setup, so unrelated CPU scheduling can consume the margin before either fake read starts. A controlled 120 ms pre-leg clock jump reproduces the assertion that both legs time out; its zero-jump neighbour passes. The original CI scheduling cause is unknown.
The case uses a private event loop whose clock advances only while idle. Fake sleeps, request budgets and elapsed-time assertions share that clock. Production deadline code remains unchanged, and this fixture does not qualify wall-clock latency.
Scope and risk
One existing unit module changes. The private clock applies to the first-content-leg case and its new controls. Every original test body, fake delay, request deadline and assertion remains unchanged. A blocked-leg control still requires an empty partial result and cancellation of both legs. Another control drains and rejects a task left on the private loop.
Module-local facades restore their bindings on exit. The standard clock and asyncio modules remain intact. The fixture relies on the selector loop used by the unit test platform.
Compatibility, rollout and rollback
Tests
.venv/bin/python -m pytest tests/unit/test_code_search_deadline.py -q --override-ini=addopts=: 29 passed.git diff --checkpass.AI assistance in the code
AI-generated: Codex wrote the fixture and controls. The original test bodies, timing inputs, production source and focused results were checked.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist