Skip to content

Give the descendant-work health test room for its second interpreter to start - #11670

Merged
danielhanchen merged 1 commit into
mainfrom
fix/health-wait-descendant-startup
Sep 23, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/health-wait-descendant-startup

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

What failed

(Python 3.13, l-r) on #11660 (job). #11660 is a frontend layout change and does not touch this code.

tests/test_llama_cpp_wait_for_health.py:1707: in test_work_done_by_a_descendant_counts
    assert ok is True
E   assert False is True
[error] llama-server health check timed out: no startup progress for 0.6s

The TypeError: 'Mock' object is not iterable printed above it comes from the stdout drain thread reading the test's mocked stdout. It is noise, not the failure.

Why

The product is right. _startup_work_sample counts work done by every descendant (root.children(recursive = True)), and this test proves that. The test itself was too tight:

  • It spawns a shim that in turn spawns the worker, so a second Python interpreter has to start before any descendant work exists.
  • The stall timeout is the helper's 0.6s default. On a loaded runner, the second interpreter's startup alone can outlast it, so the wait gives up on a load that is about to make progress.
  • Its sibling test_a_load_that_keeps_working_outlives_the_timeout does its work in the direct child, so it has no second startup to wait through.

Fix

studio/backend/tests/test_llama_cpp_wait_for_health.py only. This one test now passes timeout = 1.5 to _wait_on_child. That is still well under healthy_after = 2.5, so only descendant work can keep the wait alive long enough to report healthy.

Verification

  • The whole file passes: 87 passed.
  • Contention: the test pinned to one core shared with six busy loops, 8 runs each:
Test Failed
main (0.6s) 5 of 8
this branch (1.5s) 0 of 8
  • Sabotage: I changed _startup_work_sample to sample only the root (members = [root]) instead of its descendants. The test then fails with assert False is True within 4s.

…to start

test_work_done_by_a_descendant_counts spawns a shim that spawns the worker, so a
second Python has to start before any descendant work exists. On a loaded runner
that startup outlasted the 0.6s default and the wait gave up on a load about to make
progress (assert False is True, on #11660's l-r shard).

This test now waits with a 1.5s stall timeout, still well under healthy_after = 2.5,
so only descendant work can carry the wait past it. On a core shared with six busy
loops the old test failed 5 of 8 runs and this one 0 of 8.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-23T09:47:14.735595Z eece030 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: eece030706

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 23, 2026
@danielhanchen
danielhanchen merged commit beab871 into main Sep 23, 2026
34 of 35 checks passed
@danielhanchen
danielhanchen deleted the fix/health-wait-descendant-startup branch September 23, 2026 10:03
shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Sep 23, 2026
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…to start (unslothai#11670)

test_work_done_by_a_descendant_counts spawns a shim that spawns the worker, so a
second Python has to start before any descendant work exists. On a loaded runner
that startup outlasted the 0.6s default and the wait gave up on a load about to make
progress (assert False is True, on unslothai#11660's l-r shard).

This test now waits with a 1.5s stall timeout, still well under healthy_after = 2.5,
so only descendant work can carry the wait past it. On a core shared with six busy
loops the old test failed 5 of 8 runs and this one 0 of 8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant