Skip to content

fix(test): bump cli.test.ts runWithEnv default timeout from 10s to 30s - #1704

Closed
cv wants to merge 2 commits into
mainfrom
fix/test-cli-timeout-30s
Closed

cv wants to merge 2 commits into
mainfrom
fix/test-cli-timeout-30s

Conversation

@cv

@cv cv commented Apr 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Salvaged from #1627 by @TSavo (fork returned 503, could not push there).

  • test/cli.test.ts: bump runWithEnv default timeout from 10s to 30s
  • vitest.config.ts: add testTimeout: 30_000 and hookTimeout: 30_000 to the cli project so Vitest's per-test ceiling matches the execSync timeout

The TS migration renamed test/cli.test.js to test/cli.test.ts; the timeout change was applied to the new filename. The vitest.config.ts comment was also updated to reference .ts.

Closes #1621 (sub-item 1 of three).

Test plan

  • vitest run test/cli.test.ts -- 44/44 tests pass
  • Full CI passes

Co-authored-by: @TSavo

Summary by CodeRabbit

  • Chores
    • Increased test and hook execution timeouts to 30 seconds across the test suite.

Two coordinated changes so the timeout bump actually takes effect:

1. test/cli.test.ts: runWithEnv default timeout 10000 -> 30000.
   The CLI cold-starts a Node child for each test case via execSync.
   Under modest CPU contention on a self-hosted runner, 10s isn't
   enough — several tests would intermittently abort with ETIMEDOUT
   from execSync itself rather than from a real test failure.

2. vitest.config.ts: add testTimeout: 30_000 and hookTimeout: 30_000
   to the cli project. Vitest's default testTimeout is 5000ms, which
   would abort tests long before the 30s execSync ceiling — making the
   bumped child timeout useless on slow CI hosts.

Salvaged from #1627
Originally authored by @TSavo.
Rebased onto main after the TS migration renamed cli.test.js -> .ts.

Closes #1621 (sub-item 1 of three).

Co-Authored-By: TSavo <TSavo@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 9, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fec3601b-5916-4d75-8990-fe92ab4cf6d4

📥 Commits

Reviewing files that changed from the base of the PR and between b37f2a5 and 1460e4c.

📒 Files selected for processing (2)
  • test/cli.test.ts
  • vitest.config.ts

📝 Walkthrough

Walkthrough

Test execution timeouts increased to 30 seconds across the CLI test suite. The runWithEnv helper function default timeout parameter was raised from 10000ms to 30000ms, and vitest configuration explicitly sets both test and hook timeouts to 30 seconds for the cli project to accommodate slower execution environments.

Changes

Cohort / File(s) Summary
Test Helper Timeout
test/cli.test.ts
Updated default timeout parameter in runWithEnv function from 10000ms to 30000ms.
Vitest Configuration
vitest.config.ts
Added testTimeout: 30_000 and hookTimeout: 30_000 to cli project configuration for extended test execution budgets.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Whiskers twitch with glee—
Thirty seconds now to see
Tests bloom on slow machines,
No more flakes between!
Patience pays in destiny. 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 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: increasing the default timeout in runWithEnv from 10s to 30s in cli.test.ts.
Linked Issues check ✅ Passed The PR fully implements sub-objective 1 of issue #1621: increasing execSync timeout from 10000ms to 30000ms to prevent ETIMEDOUT failures on slower hosts.
Out of Scope Changes check ✅ Passed All changes (timeout increase in cli.test.ts and vitest config timeouts) are directly scoped to addressing the slow-host timeout issue from issue #1621, with no unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix/test-cli-timeout-30s

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

@cv

cv commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator Author

Actually don't think I want to do this. Bumping test timeouts can mask unnecessarily slow tests.

@cv cv closed this Apr 9, 2026
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions bug-fix PR fixes a bug or regression chore Build, CI, dependency, or tooling maintenance and removed CI/CD chore Build, CI, dependency, or tooling maintenance labels Jun 3, 2026
@cv
cv deleted the fix/test-cli-timeout-30s branch June 28, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, checks, release automation, or GitHub Actions bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tests] Three test-environment fragility issues (slow hosts, system PATH leakage, WSL2)

2 participants