diff --git a/CHANGELOG.md b/CHANGELOG.md index ed3ec735d..905338fee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/scripts/test-parallel.mjs b/scripts/test-parallel.mjs index e88cb2024..a60ae7847 100644 --- a/scripts/test-parallel.mjs +++ b/scripts/test-parallel.mjs @@ -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",