Skip to content

Commit af72d8e

Browse files
Copilotclaude
andcommitted
test: raise unit-test timeout to 30s to stop flaky failures
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>
1 parent 6dd2c8c commit af72d8e

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4646

4747
### Fixed
4848

49+
- Raised the Vitest unit-test timeout from the 5s default to 30s (`testTimeout`/`hookTimeout` in `vitest.config.ts`). Several unit tests perform real git operations (init/clone/commit) and filesystem fixture setup that can exceed 5s on busy CI runners, Windows, or under parallel load, causing intermittent "Test timed out in 5000ms" failures unrelated to the code under test. Fast tests are unaffected.
4950
- `bootcamp ask`, `docs`, and `diff` now honor options whose flag names collide with the root command. `ask --branch/--model`, `docs --branch`, and `diff --format/--full-clone/--keep-temp` were captured by the root command and silently ignored; they are now read from raw argv (via shared, tested `getFlagValue`/`hasFlag` helpers in `src/utils.ts`).
5051
- `bootcamp health` now honors `--branch` and `--max-files`. These short flags (`-b`/`-m`) collide with the root command's options, which captured them before the subcommand could; the command now falls back to reading raw argv (matching the `diff --output` approach). The `--json` output also gained a `filesScanned` field.
5152
- Reused shared prompt helper builders in `src/agent.ts` for standard/fast prompt construction.

vitest.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ export default defineConfig({
66
environment: "node",
77
include: ["src/**/*.test.ts", "test/**/*.test.ts"],
88
exclude: ["test/e2e/**/*.test.ts"],
9+
// Several unit tests exercise real git operations (init/clone/commit) and
10+
// filesystem fixtures. Under load — busy CI runners, Windows, or parallel
11+
// suites — these can exceed Vitest's 5s default and flake with
12+
// "Test timed out in 5000ms". Give them headroom; fast tests finish in
13+
// milliseconds and are unaffected. (E2E uses a larger budget of its own.)
14+
testTimeout: 30_000,
15+
hookTimeout: 30_000,
916
coverage: {
1017
provider: "v8",
1118
reporter: ["text", "html"],

0 commit comments

Comments
 (0)