Skip to content

test(cli): fail a command that hangs with the model server down - #7542

Merged
kovtcharov-amd merged 1 commit into
mainfrom
fix/cli-contract-down-hang
Nov 12, 2026
Merged

kovtcharov-amd merged 1 commit into
mainfrom
fix/cli-contract-down-hang

Conversation

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

The CLI contract test from #7342 misses the rc18 bug it was written to catch. With the health check removed again, gaia download --list retries each model against the dead server, is stopped at the 25 s limit, and the test skips the exit-code check and passes. Now a command that finishes with the server up must also finish with it down. Servers that are still running at the limit in both runs stay exempt.

Test plan

  • Removed the health check from download --list: test_model_server_contract[download --list] fails with this change and passed without it
  • Clean main: pytest tests/integration/test_cli_contract.py -n 4 gives 150 passed, 10 xfailed. The 2 local failures (agent status, agent health) come from stale editable installs on the test PC, as noted on test(cli): hold every gaia command to a contract, from the parser #7342
  • Probe of all 12 model-server commands: every one that exits with the server up also exits with it down, so no existing cell turns red
  • CLI Contract workflow green

The CLI contract let a command that retries a dead model server past the
25 s limit pass, so it missed the rc18 bug it names as its example:
with the health check removed, `gaia download --list` retries each model
for ~2 s, is stopped at the limit, and the exit-code check is skipped.

A command that finishes with the server up must now also finish with it
down. Servers that outlast the limit in both runs are still exempt.
@github-actions github-actions Bot added the tests Test changes label Nov 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve

This closes the gap that let gaia download --list hang on a dead model server and still pass the CLI contract test. Now a command that finishes with the server up fails the test if it is still running at the time limit with the server down. Commands that time out in both runs stay exempt. The check is narrow and sits in the right place, and the PR shows it goes red on the rc18 regression and green on clean main.

Real-world evidence

N/A: this PR only changes tests, so no evidence bundle was produced. The verdict rests on reading the code and on the author's test plan, which reports that the check fails with the download --list health check removed and that main passes (150 passed, 10 xfailed). The CLI Contract workflow run is still unchecked in the plan and should be green before merge.

🔍 Technical details

Issues found

  • 🟢 Timing sensitivity (tests/integration/test_cli_contract.py:376): a command that only just finishes inside TIMEOUT_S with the fake server up could hit the limit in the down run on a loaded runner, and this check would then flag it. The author probed all 12 model-server commands and every one exits down, so this is only a note to keep in mind if the lane turns flaky.

Strengths

  • The assertion up.code is None or down.code is not None is exactly the invariant that was missing. It runs after _not_timed_out_on_known_bug, so known-bug cells still fail as "never reached the bug" rather than through this message, and it runs before the REPORTS_SERVER_STATE early return, so those commands can't hang either.
  • The parametrized self-test covers all four up/down combinations with no subprocesses, so the logic of the rule is pinned cheaply.
  • The test plan shows the check fails without the fix (red-before-green), which is the proof this kind of test change needs.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 98370e1 Nov 12, 2026
31 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the fix/cli-contract-down-hang branch November 12, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant