Tests: cap Vitest workers on CI macOS

This commit is contained in:
rohan nagpal 2026-01-24 15:22:39 +00:00 committed by Peter Steinberger
parent 969510fc60
commit 0f7db91256
2 changed files with 6 additions and 4 deletions

View File

@ -41,7 +41,7 @@ Docs: https://docs.clawd.bot
- Google Chat: tighten email allowlist matching, typing cleanup, media caps, and onboarding/docs/tests. (#1635) Thanks @iHildy.
- Google Chat: normalize space targets without double `spaces/` prefix.
- Messaging: keep newline chunking safe for fenced markdown blocks across channels.
- Tests: cap Vitest workers to reduce CI timeouts, especially on macOS.
- Tests: cap Vitest workers on CI macOS to reduce timeouts.
## 2026.1.23-1

View File

@ -22,13 +22,15 @@ const parallelRuns = runs.filter((entry) => entry.name !== "gateway");
const serialRuns = runs.filter((entry) => entry.name === "gateway");
const children = new Set();
const isCI = process.env.CI === "true" || process.env.GITHUB_ACTIONS === "true";
const isMacOS = process.platform === "darwin" || process.env.RUNNER_OS === "macOS";
const overrideWorkers = Number.parseInt(process.env.CLAWDBOT_TEST_WORKERS ?? "", 10);
const resolvedOverride = Number.isFinite(overrideWorkers) && overrideWorkers > 0 ? overrideWorkers : null;
const localWorkers = Math.max(4, Math.min(16, os.cpus().length));
const perRunWorkers = Math.max(1, Math.floor(localWorkers / parallelRuns.length));
// Keep worker counts predictable across local runs and CI (avoid oversubscribing runners).
// Total workers ~= localWorkers since we run unit/extensions in parallel.
const maxWorkers = resolvedOverride ?? perRunWorkers;
// Keep worker counts predictable for local runs and for CI on macOS.
// In CI on linux/windows, prefer Vitest defaults to avoid cross-test interference from lower worker counts.
const maxWorkers = resolvedOverride ?? (isCI && !isMacOS ? null : perRunWorkers);
const WARNING_SUPPRESSION_FLAGS = [
"--disable-warning=ExperimentalWarning",