Repository navigation
Give every GGUF cancel-drain test the loaded-runner budget - #11662
Merged
Merged
Conversation
…the drain check deterministic test_non_streaming_gguf_cancel_drains_worker failed again with assert False on its 1.0s start wait (Backend CI on #11644). #10008 sized this for a loaded runner, but its hunk landed on the tool twin of the test it named, so that test and three others shaped like it kept waiting 1.0s for a thread-pool worker to be scheduled. All of them now use one module-level _DRAIN_BUDGET_S (30s, only reached when something is stuck). The stub workers also linger 0.3s after seeing the cancel flag, so a route that skips its drain is caught by released.is_set() every time rather than whenever the assertion beats the worker's 5 ms poll.
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
shaojun
pushed a commit
to shaojun/unsloth
that referenced
this pull request
Sep 29, 2026
…the drain check deterministic (unslothai#11662) test_non_streaming_gguf_cancel_drains_worker failed again with assert False on its 1.0s start wait (Backend CI on unslothai#11644). unslothai#10008 sized this for a loaded runner, but its hunk landed on the tool twin of the test it named, so that test and three others shaped like it kept waiting 1.0s for a thread-pool worker to be scheduled. All of them now use one module-level _DRAIN_BUDGET_S (30s, only reached when something is stuck). The stub workers also linger 0.3s after seeing the cancel flag, so a route that skips its drain is caught by released.is_set() every time rather than whenever the assertion beats the worker's 5 ms poll.
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.
What failed
(Python 3.13, l-r)on #11644 (job). #11644 touches the hub inventory, not inference.Why
The route is right. The stub worker runs on a thread-pool thread, so a 1.0s start wait measures how quickly a loaded runner schedules that thread. The shard took 528s against its usual ~400s.
This failure was already fixed once. #10008 ("Give the cancel drain a budget sized for a loaded runner") names this exact failure,
test_non_streaming_gguf_cancel_drains_worker - assert False. Its hunk, however, landed on the test's tool twin,test_gguf_tool_non_streaming_cancel_drains_worker_before_releasing_slot. The two are near-identical, and the twin is the only test that uses_DRAIN_BUDGET_S. The test #10008 named, and three others shaped like it, keptstarted.wait, 1.0andwait_for(..., timeout = 1.0).Fix
studio/backend/tests/test_openai_tool_passthrough.pyonly:_DRAIN_BUDGET_S = 30.0moves to module level, and all five cancel-drain tests use it: the two streaming ones, both non-streaming ones, and the monitor stream one. It is only reached when something is stuck._WORKER_LINGER_S = 0.3after seeing the cancel flag and before settingreleased. A route that drains its worker waits that out before raising. One that skips the drain raises first, andassert released.is_set()fails deterministically, instead of depending on the assertion beating the worker's 5 ms poll.Verification
tests/test_openai_tool_passthrough.py: 443 passed.await _drain_cancelled_gguf_task()from the non-streaming GGUFexcept asyncio.CancelledErrorinroutes/inference.py.test_non_streaming_gguf_cancel_drains_workerfails withassert False where False = is_set(), both with this branch's test file and with main's. On main that catch relied on the 5 ms race, which it won 5 of 5 times locally.