Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe CLI test timeout was increased: Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR reduces CLI test flakiness on slower/contended CI hosts by increasing the default execSync timeout used by the runWithEnv helper in test/cli.test.js.
Changes:
- Increase
runWithEnvdefault timeout from 10s to 30s for CLI invocations in the test suite.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@test/cli.test.js`:
- Line 16: The tests set execSync's timeout to 30000ms inside runWithEnv but
Vitest's own default timeout (10s) will still abort tests; update the test suite
to increase Vitest's timeout to at least match execSync by calling
vi.setTimeout(30000) (or a larger value) near the top of the test file before
tests run, or alternatively bump the cli project's timeout in Vitest config;
ensure you reference runWithEnv and its use of execSync so the framework-level
timeout aligns with the execSync timeout to prevent ETIMEDOUT flakes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 2c559d89-e739-4a82-a50f-943d06b8a964
📒 Files selected for processing (1)
test/cli.test.js
a4c09c6 to
18c9d7e
Compare
|
Force-pushed to add a Ready for a maintainer to approve workflow runs whenever you have a moment — first-time-contributor gate. |
… timeout to 30s Two coordinated changes so the timeout bump actually takes effect: 1. `test/cli.test.js`: `runWithEnv` default `timeout` 10000 → 30000. The CLI cold-starts a Node child for each test case via `execSync`. Under modest CPU contention from a sibling job 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, masking actual output and making the suite flaky on slower hardware. 2. `vitest.config.ts`: add `testTimeout: 30_000` and `hookTimeout: 30_000` to the `cli` project. Why both: Vitest's default `testTimeout` is 5000ms. Bumping `execSync`'s timeout to 30s WITHOUT also bumping vitest's per-test ceiling is a no-op — vitest aborts the whole test at 5s long before execSync's 30s timer can fire. CodeRabbit caught this on the original single-file PR (NVIDIA#1627) and they're correct: the two ceilings have to move together for the bump to actually unflake anything. The new ceiling (30s) is still reasonable: tests still finish in milliseconds when nothing's wrong, and a genuinely-stuck test surfaces as a timeout — just at 30s instead of 5s. Per-call sites that explicitly pass a third argument to `runWithEnv` continue to override the default unchanged. Closes NVIDIA#1621 (sub-item 1 of three). Signed-off-by: T Savo <evilgenius@nefariousplan.com>
18c9d7e to
2634408
Compare
|
@coderabbitai you're right — the original single-file change was effectively a no-op because Vitest's default Diff is now +7 / −1 across two files:
Tests still finish in milliseconds when nothing's wrong; the new ceiling only fires when something is genuinely stuck. Per-call sites that override the third positional argument continue to work unchanged. Commit message updated to reflect the two-file scope. Re-review welcome. |
|
The two-ceiling approach is correct:
With both ceilings at 30 s and fast-path tests still completing in milliseconds, this should resolve the ETIMEDOUT flakes without masking genuinely stuck tests. Triggering a fresh review now. 🧠 Learnings used✅ Actions performedFull review triggered. |
|
✨ Thanks for submitting this PR, which proposes a way to fix a test environment fragility issue by increasing the default timeout for the runWithEnv function in cli.test.js. Possibly related open PRs:
Possibly related open issues: |
cv
left a comment
There was a problem hiding this comment.
LGTM — test-infrastructure only. Timeout bump + Vitest config alignment. No production code, no concerns.
|
@TSavo Thanks for this fix! Your fork is returning 503 so I couldn't push the rebased version there. I salvaged the changes into #1704 — rebased onto main after the TS migration renamed Closing this PR in favor of the new one. |
|
Superseded by #1704 (rebased onto main, fork 503) |
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 NVIDIA#1627 Originally authored by @TSavo. Rebased onto main after the TS migration renamed cli.test.js -> .ts. Closes NVIDIA#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>
Summary
One-line change: bump
runWithEnv's defaulttimeoutintest/cli.test.jsfrom 10s to 30s. The CLI cold-starts a Node child for each test case, and 10s isn't enough on a self-hosted runner under modest CPU contention — several tests would intermittently abort withETIMEDOUTfromexecSyncitself rather than from a real test failure.Related Issue
Closes #1621 (sub-item 1 of three:
runWithEnvtimeout too low for slow CI hosts).Changes
test/cli.test.js:function runWithEnv(args, env = {}, timeout = 10000)→... timeout = 30000. Per-call sites that explicitly pass a third argument continue to override the default unchanged.Diff: +1 / −1 in 1 file.
Type of Change
Testing
npx vitest run --project cli test/cli.test.js— entire suite passes locallynpx prettier --check test/cli.test.jscleannpx prek run --all-files/npm test— not run on the local machine because the full CLI test suite hits two separate baseline failures on a WSL2 host: theshouldPatchCorednsissue covered by fix(platform): allow shouldPatchCoredns isWsl override for deterministic WSL2 tests #1626 and theinstall-preflightsysbin leakage covered by fix(test): isolate sysbin in install-preflight tests to prevent host PATH leakage #1628. Upstream CI runs on Linux runners so it'll exercise the full suite normally.make docsbuilds without warnings. (for doc-only changes — N/A)Checklist
General
Code Changes
npx prettier --checkclean.Doc Changes
Signed-off-by: T Savo evilgenius@nefariousplan.com
Summary by CodeRabbit