diff --git a/scripts/__tests__/run-vitest-watchdog.test.mjs b/scripts/__tests__/run-vitest-watchdog.test.mjs index fa4c8411a6..3d9f4f791b 100644 --- a/scripts/__tests__/run-vitest-watchdog.test.mjs +++ b/scripts/__tests__/run-vitest-watchdog.test.mjs @@ -39,7 +39,9 @@ test("deriveBudgetMs: no fresh timing falls back to the per-class ceiling", () = test("deriveBudgetMs: fresh timing tightens within the band", () => { // expected×multiplier between floor and ceiling → use the tightened value. - const expected = 200_000; // 200s + // 300s × 3.5 = 1050s, which sits between the shard floor (15min) and + // ceiling (30min) so the tightened value is used un-clamped. + const expected = 300_000; // 300s const derived = deriveBudgetMs({ klass: "shard", expectedDurationMs: expected, timingsFresh: true }); assert.equal(derived, Math.round(expected * DEFAULT_BUDGET_MULTIPLIER)); assert.ok(derived >= CLASS_BUDGET_BANDS.shard.floor); diff --git a/scripts/lib/run-vitest-watchdog.mjs b/scripts/lib/run-vitest-watchdog.mjs index b047a70b07..362ca0623a 100644 --- a/scripts/lib/run-vitest-watchdog.mjs +++ b/scripts/lib/run-vitest-watchdog.mjs @@ -36,7 +36,17 @@ const MINUTE = 60_000; */ export const CLASS_BUDGET_BANDS = { // One CI shard command (may fan out across several packages via --filter). - shard: { floor: 5 * MINUTE, ceiling: 30 * MINUTE }, + // Floor is 15min, not 5min: the heaviest shard slices (@fusion/engine and + // @fusion/core, each split [1/2]+[2/2]) are import- and real-git-subprocess + // heavy, and the committed scripts/test-timings.json undercounts that + // overhead (most files bucket to the 100ms floor; the snapshot total is far + // below current wall-clock). A "fresh" but undercounting snapshot was + // tightening these slices to ~340-405s and SIGKILLing healthy runs on slower + // CI runners — the exact false-kill the band is meant to prevent (see the + // deriveBudgetMs note above and KTD-2). 15min sits comfortably above the + // observed CI need while still bounding a true hang far under the job's + // 60min ceiling. Mirrors the dashboard-lane heavy-lane floor. + shard: { floor: 15 * MINUTE, ceiling: 30 * MINUTE }, // One local changed-file package invocation. changed: { floor: 2 * MINUTE, ceiling: 20 * MINUTE }, // One dashboard quality lane (heap-managed). Matches the historical 15min.