Tests: cap Vitest workers on CI macOS
This commit is contained in:
parent
969510fc60
commit
0f7db91256
@ -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: tighten email allowlist matching, typing cleanup, media caps, and onboarding/docs/tests. (#1635) Thanks @iHildy.
|
||||||
- Google Chat: normalize space targets without double `spaces/` prefix.
|
- Google Chat: normalize space targets without double `spaces/` prefix.
|
||||||
- Messaging: keep newline chunking safe for fenced markdown blocks across channels.
|
- 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
|
## 2026.1.23-1
|
||||||
|
|
||||||
|
|||||||
@ -22,13 +22,15 @@ const parallelRuns = runs.filter((entry) => entry.name !== "gateway");
|
|||||||
const serialRuns = runs.filter((entry) => entry.name === "gateway");
|
const serialRuns = runs.filter((entry) => entry.name === "gateway");
|
||||||
|
|
||||||
const children = new Set();
|
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 overrideWorkers = Number.parseInt(process.env.CLAWDBOT_TEST_WORKERS ?? "", 10);
|
||||||
const resolvedOverride = Number.isFinite(overrideWorkers) && overrideWorkers > 0 ? overrideWorkers : null;
|
const resolvedOverride = Number.isFinite(overrideWorkers) && overrideWorkers > 0 ? overrideWorkers : null;
|
||||||
const localWorkers = Math.max(4, Math.min(16, os.cpus().length));
|
const localWorkers = Math.max(4, Math.min(16, os.cpus().length));
|
||||||
const perRunWorkers = Math.max(1, Math.floor(localWorkers / parallelRuns.length));
|
const perRunWorkers = Math.max(1, Math.floor(localWorkers / parallelRuns.length));
|
||||||
// Keep worker counts predictable across local runs and CI (avoid oversubscribing runners).
|
// Keep worker counts predictable for local runs and for CI on macOS.
|
||||||
// Total workers ~= localWorkers since we run unit/extensions in parallel.
|
// In CI on linux/windows, prefer Vitest defaults to avoid cross-test interference from lower worker counts.
|
||||||
const maxWorkers = resolvedOverride ?? perRunWorkers;
|
const maxWorkers = resolvedOverride ?? (isCI && !isMacOS ? null : perRunWorkers);
|
||||||
|
|
||||||
const WARNING_SUPPRESSION_FLAGS = [
|
const WARNING_SUPPRESSION_FLAGS = [
|
||||||
"--disable-warning=ExperimentalWarning",
|
"--disable-warning=ExperimentalWarning",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user