test: raise unit-test timeout to 30s to eliminate flaky CI failures#57
Merged
Merged
Conversation
Several unit tests do real git work (init/clone/commit) and filesystem fixture setup. Under load — busy CI runners, Windows, or parallel suites — these occasionally exceed Vitest's 5s default and fail with "Test timed out in 5000ms", which has shown up as intermittent red on Windows CI and locally when running suites concurrently. The failures are environmental, not logic bugs (the same tests pass on rerun). Raise testTimeout/hookTimeout to 30s in vitest.config.ts. Fast tests finish in milliseconds and are unaffected; only genuinely slow/contended tests get the headroom. Mirrors the approach already used in vitest.e2e.config.ts (90s). Verified stable across repeated and concurrent full-suite runs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
af72d8e to
f498316
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Raises the Vitest unit-test timeout from the 5s default to 30s (
testTimeoutandhookTimeoutinvitest.config.ts).Why
Several unit tests perform real git operations (
git init/clone/commit) and filesystem fixture setup — e.g.flags-behavior,main-command.behavior,ask-command,clone-service,ingest.clone,repo-resolver-branch. Under load (busy CI runners, Windows, or running suites in parallel) these occasionally exceed the 5s default and fail with:This surfaced as intermittent red on the Windows, Node 20 CI job (a rerun passed cleanly) and is reproducible locally by running two full suites concurrently. The failures are environmental — the same tests pass on rerun — not logic bugs.
Fix
Give unit tests headroom with a 30s timeout. Fast tests finish in milliseconds and are completely unaffected; only genuinely slow/contended tests benefit. This mirrors the approach already taken in
vitest.e2e.config.ts(90s).Verification
🤖 Generated with Claude Code