Repository navigation
Give the launcher signal tests a worker to themselves - #11085
Merged
Merged
Conversation
`Repo tests (CPU, python)` failed on an unrelated PR with a 120s timeout in `tests/kaggle/test_launch_cleanup.py::test_a_reentrant_log_inside_the_delete_retries_does_not_abandon_them`: ``` AssertionError: the launcher was still alive 120s after its signal. Launcher said: (nothing logged after READY) Stack at the abort: Fatal Python error: Aborted Current thread (most recent call first): File ".../test_a_reentrant_log_inside_th0/runner.py", line 22 in <module> ``` The file's own faulthandler diagnostic answers this: line 22 is the stall, so the child never reached its signal handler at all. The budget stopped measuring "did the handler run" and started measuring "was the child ever scheduled". ## Why it happens The step runs `-n 4` with xdist's default `load` scheduling, so these tests are free to land on four workers of a four-core runner at once. Each starts a real launcher subprocess and signals it, so four of them together are eight processes contending for four cores. `_DEATH_BUDGET_SEC`'s comment already records this pressure, noting the SIGINT case once needed over 30 seconds purely to be scheduled. ## The fix Put the file in one xdist group so its tests share a worker, and pass `--dist loadgroup` on the two jobs that run them. Ungrouped tests still distribute exactly as before, so this costs no parallelism anywhere else. Raising the budget was the alternative and it is the wrong lever: the test would still be timing how loaded the box is, just with a larger number, and a real hang would take longer to report. ## Verification Worker assignment over the same selection, measured rather than assumed: | scheduling | workers used | | --- | --- | | `--dist loadgroup` | `gw3` only | | default `load` | `gw0`, `gw1`, `gw2`, `gw3` | Whole file under the CI flags, `-n 4 --dist loadgroup --timeout=330`: 27 passed. The failure this addresses is a flake, so a green run does not prove much on its own. What is checked here is the mechanism: the tests now share a worker, which removes the contention the stack pointed at.
Member
Author
|
@codex review |
|
You have reached your Codex usage limits for security reviews. Please try again later. |
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. 👍 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". |
danielhanchen
added a commit
that referenced
this pull request
Sep 16, 2026
) `Backend CI` has been red on main since the reasoning-budget controls landed, with three multi-account tests answering `{"detail":"Failed to get status"}`, a message naming neither the field nor the cause. Four reasoning fields were added to `_InferenceRuntimeFields` and they are not Optional, which is right: `LlamaCppBackend.__init__` sets `_reasoning_budget = -1` and `_reasoning_budget_message = ""`, so the real backend never answers None for them. `_llama_runtime_fields` mirrors every field in that model off the backend, and the test doubles answered None for anything nobody set, so /status raised ValidationError and the route returned 500. The PR that added the fields is correct; the doubles were not. ## What changed `FakeLlamaCppBackend` carries the runtime surface /status mirrors, at the values `LlamaCppBackend.__init__` gives them. The same block was being re-declared by hand in the per-test fakes, which is what the shared double exists to end. Fields the real backend holds only as `_name` are declared under that name, so the double claims nothing production cannot read. The blanket `__getattr__` several fakes carried defeated that fallback: answering None for the public name hides the private slot that has the value. It lives on the shared double now, scoped to the names /status mirrors and taken from the model rather than listed. Everything else raises `AttributeError` as before, so `getattr(backend, name, default)` keeps its default; a blanket version broke `supports_tool_passthrough` defaulting to `supports_tools`, which Codex caught during review. Attributes the status route reads straight off the backend rather than through the model-field loop are declared too, at the real backend's initial values. ## Coverage The existing canary drives /chat/completions and never reaches this. A second one builds the /status runtime payload from the bare double and validates it, failing with the offending field in the message. Mutation-tested: removing the four reasoning fields reproduces the original break and the canary names all four; answering None instead of the private slot names the seven private-only fields; restoring the blanket fallback fails the video chat-completions tests. All nine files that use the double pass, 110 tests. `(Python 3.13, rest)` is green here, against red on main. The two remaining red jobs are inherited from main and fixed elsewhere: the studio shard by #11065, and the python shard's kaggle launcher flake by #11085.
shaojun
pushed a commit
to shaojun/unsloth
that referenced
this pull request
Sep 29, 2026
…lothai#11076) `Backend CI` has been red on main since the reasoning-budget controls landed, with three multi-account tests answering `{"detail":"Failed to get status"}`, a message naming neither the field nor the cause. Four reasoning fields were added to `_InferenceRuntimeFields` and they are not Optional, which is right: `LlamaCppBackend.__init__` sets `_reasoning_budget = -1` and `_reasoning_budget_message = ""`, so the real backend never answers None for them. `_llama_runtime_fields` mirrors every field in that model off the backend, and the test doubles answered None for anything nobody set, so /status raised ValidationError and the route returned 500. The PR that added the fields is correct; the doubles were not. ## What changed `FakeLlamaCppBackend` carries the runtime surface /status mirrors, at the values `LlamaCppBackend.__init__` gives them. The same block was being re-declared by hand in the per-test fakes, which is what the shared double exists to end. Fields the real backend holds only as `_name` are declared under that name, so the double claims nothing production cannot read. The blanket `__getattr__` several fakes carried defeated that fallback: answering None for the public name hides the private slot that has the value. It lives on the shared double now, scoped to the names /status mirrors and taken from the model rather than listed. Everything else raises `AttributeError` as before, so `getattr(backend, name, default)` keeps its default; a blanket version broke `supports_tool_passthrough` defaulting to `supports_tools`, which Codex caught during review. Attributes the status route reads straight off the backend rather than through the model-field loop are declared too, at the real backend's initial values. ## Coverage The existing canary drives /chat/completions and never reaches this. A second one builds the /status runtime payload from the bare double and validates it, failing with the offending field in the message. Mutation-tested: removing the four reasoning fields reproduces the original break and the canary names all four; answering None instead of the private slot names the seven private-only fields; restoring the blanket fallback fails the video chat-completions tests. All nine files that use the double pass, 110 tests. `(Python 3.13, rest)` is green here, against red on main. The two remaining red jobs are inherited from main and fixed elsewhere: the studio shard by unslothai#11065, and the python shard's kaggle launcher flake by unslothai#11085.
shaojun
pushed a commit
to shaojun/unsloth
that referenced
this pull request
Sep 29, 2026
`Repo tests (CPU, python)` failed with a 120s timeout in
`test_a_reentrant_log_inside_the_delete_retries_does_not_abandon_them`:
AssertionError: the launcher was still alive 120s after its signal.
Launcher said: (nothing logged after READY)
Stack at the abort: Current thread (most recent call first):
File ".../runner.py", line 22 in <module>
The file's own faulthandler diagnostic answers it: line 22 is the stall, so the child never
reached its signal handler. The budget stopped measuring "did the handler run" and started
measuring "was the child ever scheduled".
## Why
The step runs `-n 4` with xdist's default `load` scheduling, so these tests are free to land on
four workers of a four-core runner at once. Each starts a real launcher subprocess and signals
it, so four together are eight processes contending for four cores. `_DEATH_BUDGET_SEC`'s own
comment records this pressure, noting the SIGINT case once needed over 30 seconds purely to be
scheduled.
## The fix
Put the file in one xdist group so its tests share a worker, and pass `--dist loadgroup` on the
two jobs that run them. Ungrouped tests distribute exactly as before, so no parallelism is lost
elsewhere.
Raising the budget was the alternative and it is the wrong lever: the test would still be timing
how loaded the box is, just with a larger number, and a real hang would take longer to report.
## Verification
Worker assignment over the same selection, measured rather than assumed:
--dist loadgroup gw3 only
default load gw0, gw1, gw2, gw3
Whole file under the CI flags, `-n 4 --dist loadgroup --timeout=330`: 27 passed.
The failure it addresses is a flake, so a green run proves little on its own. What is checked is
the mechanism: the tests now share a worker, which removes the contention the stack pointed at.
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.
Summary
Repo tests (CPU, python)failed on an unrelated PR with a 120s timeout intests/kaggle/test_launch_cleanup.py::test_a_reentrant_log_inside_the_delete_retries_does_not_abandon_them:The file's own faulthandler diagnostic answers this: line 22 is the stall, so the child never reached its
signal handler at all. The budget stopped measuring "did the handler run" and started measuring "was the
child ever scheduled".
Why it happens
The step runs
-n 4with xdist's defaultloadscheduling, so these tests are free to land on fourworkers of a four-core runner at once. Each starts a real launcher subprocess and signals it, so four
of them together are eight processes contending for four cores.
_DEATH_BUDGET_SEC's comment alreadyrecords this pressure, noting the SIGINT case once needed over 30 seconds purely to be scheduled.
The fix
Put the file in one xdist group so its tests share a worker, and pass
--dist loadgroupon the twojobs that run them. Ungrouped tests still distribute exactly as before, so this costs no parallelism
anywhere else.
Raising the budget was the alternative and it is the wrong lever: the test would still be timing how
loaded the box is, just with a larger number, and a real hang would take longer to report.
Verification
Worker assignment over the same selection, measured rather than assumed:
--dist loadgroupgw3onlyloadgw0,gw1,gw2,gw3Whole file under the CI flags,
-n 4 --dist loadgroup --timeout=330: 27 passed.The failure this addresses is a flake, so a green run does not prove much on its own. What is checked
here is the mechanism: the tests now share a worker, which removes the contention the stack pointed at.