test(codex): give the shutdown regressions a timeout longer than their own bounds - #649
Conversation
…r own bounds Both shutdown tests ran under Vitest's default 5s per-test timeout, which is shorter than the bounds they set for themselves: `spawnSync` is capped at 12s, and the SIGTERM test then polls up to 4s for the helper to be reaped. Two consequences, both real: - The SIGTERM test could exceed 5s and fail as a flake. It does so reliably on Linux as a non-root user, which is exactly how CI runs; it passed locally only because the helper happened to die fast enough. - The 12s spawn bound could never report anything. Vitest killed the test at 5s first, so a genuinely stuck wrapper surfaced as a bare "Test timed out in 5000ms" instead of the diagnostic the bound exists to produce — defeating the point of bounding it in the first place. Give both an explicit 30s per-test timeout so they outlast their internal bounds. Verified on Linux as a non-root user at the default timeout: the SIGTERM test now passes, and against the unfixed wrapper the failure reads "wrapper never returned within 12000ms: the helper ignored SIGTERM" rather than a Vitest timeout. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0139f4WZCmWykXZcdEmWTusj
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
📝 Walkthroughthis is a minor, test-only change. it adds explicit 30-second timeouts to the two shutdown regression tests in
Walkthroughthe shutdown tests now use a 30-second timeout. this allows their internal Changesshutdown test timing
Estimated code review effort: 1 (trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
A corrective release. No new features and no configuration changes. Patch rather than minor: 2.8.0 was minor because it changed where the official CLI keeps its state. This one only corrects behaviour that was already meant to work, adds no settings, and writes nothing new to disk — the same shape as 2.7.1. mcodex resume and mcodex fork hung on a blank TUI whenever runtime rotation was enabled. Both are interactive TUI entry points that carry a forwarded subcommand, so 2.8.0's interactive classification — which matched only an invocation with no subcommand — missed them and left them on the shadow home, whose mirror deliberately omits the runtime SQLite state. Both now use the canonical-home transport, with rotation still enabled. The wrapper could also fail to return to the shell after an interrupted or non-zero exit, because helper shutdown left the detached helper's pipes referenced. Shutdown is now bounded and releases those handles. Separately, --help no longer starts a rotation transport for any request command. Also clears four high-severity advisories that were failing npm run audit:ci: hono 4.12.21 -> 4.12.33 and undici 6.25.0 -> 6.28.0, plus brace-expansion and postcss pinned through overrides for the dev graph. Closes ndycode#647. Landed as ndycode#648, ndycode#649, and ndycode#650. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0139f4WZCmWykXZcdEmWTusj
Summary
What Changed
test/codex-bin-wrapper.test.tsgives both shutdown tests an explicit 30s per-test timeout.Two distinct consequences of the missing timeout, both real:
The SIGTERM test could exceed 5s and fail. Its budget is the wrapper's 2s graceful window plus up to 4s of polling for the helper to be reaped, plus spawn overhead — over 5s in the worst case. It passed locally only because the helper usually died fast. As a non-root user on Linux it failed reliably with
Test timed out in 5000ms.The 12s
spawnSyncbound could never report anything. fix(codex): route resume/fork through the canonical home and bound helper shutdown (#647) #648 added that bound specifically so a stuck wrapper would fail with a useful message instead of hanging the run. But Vitest killed the test at 5s first, so the message never printed. The bound was inert for its stated purpose.Validation
Linux, non-root, default timeout (the configuration that exposed this):
FAIL ... force-stops an app helper that ignores SIGTERM (#647)→Test timed out in 5000msAnd against the unfixed wrapper, the diagnostic now surfaces as intended:
rather than a bare Vitest timeout.
npm run lintnpm run typechecknpm test— Windows: 5315 passed, 4 skipped, 0 failedRisk and Rollback
Additional Notes
Worth flagging separately:
vitest.config.tssets notestTimeout, so every test in this repo runs under the 5s default. Any other test that spawns real subprocesses is exposed to the same class of flake. This PR only fixes the two tests it introduced.note: greptile review for oc-chatgpt-multi-auth. cite files like
lib/foo.ts:123. confirm regression tests + windows concurrency/token redaction coverage.Greptile Summary
this pr gives two shutdown regression tests enough time to reach their own bounded failure diagnostics instead of vitest’s 5s default timeout.
Confidence Score: 5/5
this test-only change appears safe to merge.
the 30s outer timeout exceeds all bounded work in both shutdown tests, while their existing 12s process timeout still produces the intended diagnostic first.
Important Files Changed
Reviews (1): Last reviewed commit: "test(codex): give the shutdown regressio..." | Re-trigger Greptile