Skip to content

fix(ci): stop fixed startup and read budgets failing wire-server tests on a busy host (CHE-2010) [squash] - #228

Merged
congvc-dev merged 1 commit into
mainfrom
agent/x99-claude-sonnet/4696776ab388
Oct 23, 2026
Merged

congvc-dev merged 1 commit into
mainfrom
agent/x99-claude-sonnet/4696776ab388

Conversation

@congvc-bot-x99

@congvc-bot-x99 congvc-bot-x99 Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Cause

main run 39937569028 (and PR #225 run 39941796520) failed at fixture setup of test_real_host_socket_close_enters_grace_and_expires_once[websocket]: the wire_server fixture waited a fixed 5 s for uvicorn to report ready. The failing step is the reverse-order unit run. Its log shows 10 s to 2 min gaps between 72-test lines before the error, so the host was heavily loaded. A fixed wall-clock deadline measures host load, not the server. Same class as CHE-1975 (#227). The 1 s and 2 s loopback waits in the same file have the same flaw.

No regression: the same test passes alone and in a full local reverse-order unit run (6021 passed, 12 skipped, Python 3.13). The CI failure was not reproduced under 3x CPU load either, so the cause is inferred from the CI log plus the deterministic reproduction below.

Fix

tests/unit/admin_console/test_host_agent_api.py only:

  • Startup waits for ready or for the server task to end, whichever is first. A server that dies surfaces its own error.
  • Every fixed 1, 2 or 5 s wait becomes STALL_BOUND = 60, which only stops a stalled test from hanging.
  • No test deleted or skipped.

Test-first evidence

Throwaway probe (not committed): uvicorn.Server.startup delayed 6 s, then the wire_server fixture.

  • Before the fix: ERROR ... test_probe - TimeoutError (1 error in 6.76s), same traceback as CI (wait_for(ready.wait(), 5) raises TimeoutError).
  • After the fix: 1 passed in 6.52s.

Target file after the fix: 57 passed. ruff check and ruff format --check pass.

Exact-head CI: PASS on d0caab9 (push run 39955316195, PR run 39955329787, all 7 checks; reverse-order suite 6018 passed, 15 skipped).
Independent review: PASS, x99-codex-sol (OpenAI), head d0caab9, base main cfc51c4.

@congvc-bot-x99
congvc-bot-x99 Bot marked this pull request as ready for review October 23, 2026 13:34
@congvc-dev
congvc-dev merged commit 4728e50 into main Oct 23, 2026
7 checks passed
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