chore: Split vitest timeout per suite (unit 30s, integration 120s)#1071
Merged
jirispilka merged 1 commit intoJul 10, 2026
Merged
Conversation
What we're solving: vitest.config.ts applied one global testTimeout of 120_000 ms (sized for integration tests that hit the live Apify API) to every test. Unit tests run in ~7s, so a hung unit test took two minutes to fail instead of failing fast. How: replace the flat test block with test.projects — a `unit` project (tests/unit/**, 30s timeout) and an `integration` project (tests/integration/**, 120s timeout), each extends:true to inherit the shared globals/environment. No package.json changes; test:unit and test:integration keep running only their own suites. Alternatives considered: a per-script CLI --testTimeout flag (rejected — the split would live only in package.json and silently fall back to 120s for any invocation not going through that script, e.g. IDE or watch mode); a second config file (rejected — two files to keep in sync). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016pXZvhEoE6Lz3DpBSL3n1Y
9 tasks
RobertCrupa
approved these changes
Jul 10, 2026
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.
Part of #1066 (checkbox: split the vitest timeout).
What we're solving
vitest.config.tsapplied one globaltestTimeoutof 120_000 ms — sized for integration tests, which hit the live Apify API and can legitimately run long — to every test. Unit tests finish in ~7s, so a hung unit test took two minutes to surface instead of failing fast.How
Replace the flat
testblock withtest.projects:unitproject —tests/unit/**,testTimeout: 30_000integrationproject —tests/integration/**,testTimeout: 120_000Each uses
extends: trueto inherit the sharedglobals/environment. Nopackage.jsonchanges —test:unitandtest:integrationkeep running only their own suites.Alternatives considered
--testTimeoutflag — rejected; the split would live only inpackage.jsonand silently fall back to 120s for any invocation not going through that exact script (IDE, watch mode, barevitest run).Verification
pnpm run test:unit: 70 files / 959 passed / 2 skipped — matches the pre-change baseline, no double-run.[unit](959 tests) /[integration](230 tests).Test timed out in 30000ms; an integration probe passes at 35.5s — confirming the 30s vs 120s split is live per project.🤖 Generated with Claude Code
https://claude.ai/code/session_016pXZvhEoE6Lz3DpBSL3n1Y
Generated by Claude Code