From a977aea9afa8119e7b9881126cc783ef9b3b2668 Mon Sep 17 00:00:00 2001 From: Nathan Nguyen <146415969+NathanDrake2406@users.noreply.github.com> Date: Mon, 27 Jul 2026 17:44:09 +1000 Subject: [PATCH 1/2] test: give the unit project the integration timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The unit project set no `testTimeout`, so it inherited vitest's 5s default while holding 47 files that boot a dev server or run a production build. 39 of those pass a per-test timeout (up to 180_000); the ones that did not sat on a ~20% margin — `middleware-matcher-auth.test.ts`'s auth-guard case measures 4.0s under normal parallel load — which ordinary CI variance erases. It and `typegen.test.ts` each failed a different CI run that way while passing locally. Adopts the 30000 the integration project already declares. A timeout costs wall-clock only when a test hangs, so nothing that passes slows down, and per-test arguments still take precedence. Closes #2719 --- vite.config.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index 80c127e073..a54a8e8ede 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -171,6 +171,12 @@ export default defineConfig({ test: { name: "unit", setupFiles: [MSW_SETUP], + // Matches the integration project. 47 files here boot a dev server or + // run a build, and vitest's 5s default left the ones that forgot a + // per-test timeout on a ~20% margin (middleware-matcher-auth's + // auth-guard case measures 4.0s under parallel load). Per-test + // `it(…, fn, N)` still wins. + testTimeout: 30000, // `scripts/**` covers the release-tooling unit tests // (scripts/create-changeset.test.ts, scripts/version.test.ts), which // are pure-logic and have no fixture/server dependencies. From 2abd6611e3713b99d6f0dc1c4afa46a8095dde6b Mon Sep 17 00:00:00 2001 From: James Date: Mon, 27 Jul 2026 10:09:11 +0100 Subject: [PATCH 2/2] test(middleware): scope auth guard timeout --- tests/middleware-matcher-auth.test.ts | 2 +- vite.config.ts | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/middleware-matcher-auth.test.ts b/tests/middleware-matcher-auth.test.ts index dc51987b52..7bffb73661 100644 --- a/tests/middleware-matcher-auth.test.ts +++ b/tests/middleware-matcher-auth.test.ts @@ -149,7 +149,7 @@ describe("valid middleware matcher auth guards", () => { it("blocks every path selected by group and constrained-repeat matchers", async () => { await assertAuthGuard(baseUrl); - }); + }, 30_000); }); describe("built Node production server", () => { diff --git a/vite.config.ts b/vite.config.ts index a54a8e8ede..80c127e073 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -171,12 +171,6 @@ export default defineConfig({ test: { name: "unit", setupFiles: [MSW_SETUP], - // Matches the integration project. 47 files here boot a dev server or - // run a build, and vitest's 5s default left the ones that forgot a - // per-test timeout on a ~20% margin (middleware-matcher-auth's - // auth-guard case measures 4.0s under parallel load). Per-test - // `it(…, fn, N)` still wins. - testTimeout: 30000, // `scripts/**` covers the release-tooling unit tests // (scripts/create-changeset.test.ts, scripts/version.test.ts), which // are pure-logic and have no fixture/server dependencies.