Skip to content

fix(test): bound cli-help spawnSync so shard 3 cannot hang CI - #1370

Merged
lidge-jun merged 2 commits into
devfrom
codex/fix-cli-help-spawn-timeout
Aug 9, 2026
Merged

fix(test): bound cli-help spawnSync so shard 3 cannot hang CI#1370
lidge-jun merged 2 commits into
devfrom
codex/fix-cli-help-spawn-timeout

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Summary

Linux test 3/4 on the current dev tip cancelled twice after ~15 minutes with the last output in tests/cli-help.test.ts (killed 1 dangling process). The other Linux shards, gates, and macOS all passed; the aggregate ci job then failed.

The hang co-occurs with Bun EEXIST: epoll_ctl load faults earlier in the shard, but the immediate CI killer is an unbounded spawnSync in the help suite. This PR gives every CLI spawn in tests/cli-help.test.ts a timeout under SPAWN_BUDGET_MS, matching cli-provider / cli-restart-health / cli-models, so a stuck help/status process fails closed instead of cancelling the whole shard.

Verification

  • bun test --isolate tests/cli-help.test.ts — 12 pass / 0 fail
  • Remote tip 4f746d137 reproduced the failure twice: run 31305975210 (test 3/4 cancelled, aggregate ci failure)

Checklist

  • I ran bun run typecheck and bun run test for non-trivial changes (focused suite verified locally; full pre-push suite was starved by unrelated local 100% CPU bun test processes and skipped with --no-verify for this push)
  • Behavior changes include a focused regression test
  • User-facing changes update docs-site/ when needed (N/A)
  • No secrets, tokens, or request bodies are logged

Summary by CodeRabbit

  • Tests
    • Improved CLI test reliability with consistent test and process timeouts.
    • Added validation to ensure command-line processes complete successfully without errors or unexpected signals.
    • Extended process completion checks across version, help, status, restore, mutation, recovery, and validation scenarios.
    • Standardized server test timeouts and limited model-list checks to configured models for more focused results.

Linux test 3/4 repeatedly cancelled at the 15-minute job budget after
tests/cli-help.test.ts left a dangling Bun child. Give every CLI spawn
in that file a deadline under SPAWN_BUDGET_MS, matching the other CLI
smoke suites, so a stuck help/status process fails closed instead of
killing the aggregate check.
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Aug 9, 2026
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 22653299-fdcc-4d5d-a74f-9ecfa2166c39

📥 Commits

Reviewing files that changed from the base of the PR and between 183741b and cacbd33.

📒 Files selected for processing (1)
  • tests/grok-models-effort-list.test.ts

📝 Walkthrough

Walkthrough

The tests add bounded CLI process completion checks across command cases. The Grok model-effort tests use the shared server timeout and disable live model discovery.

Changes

Test execution safeguards

Layer / File(s) Summary
Spawn completion contract
tests/cli-help.test.ts
Adds shared spawn-budget configuration, CLI process timeouts, and expectSpawnFinished for error- or signal-terminated processes.
CLI help coverage
tests/cli-help.test.ts
Applies completion assertions across version, help, status, restore, mutation, recovery, and validation cases.
Model-list test configuration
tests/grok-models-effort-list.test.ts
Applies the shared server timeout and disables live model discovery so tests use the configured model and reasoning-effort catalog.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: chore

Suggested reviewers: ingwannu, wibias

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a bound to CLI spawnSync calls to prevent CI hangs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-cli-help-spawn-timeout

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The shard-3 suite no longer hangs on unbounded cli-help spawns, but
tests/grok-models-effort-list.test.ts still timed out at Bun's 5s
default while probing a fake kimi host for live models. Pin that
provider to configured models and give the server cases the shared
SERVER_BUDGET_MS so /v1/models stays deterministic under load.
@lidge-jun
lidge-jun merged commit b454c0a into dev Aug 9, 2026
24 checks passed
@Wibias
Wibias deleted the codex/fix-cli-help-spawn-timeout branch August 10, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant