Files
clean-architecture-frontend…/scripts/lib/playwright-ci-workers.ts

16 lines
747 B
TypeScript

/**
* FE-3 (1) (CI-FE-0002). The runner's job container sees 12 CPUs under a 6-CPU
* quota, so Playwright's default (half of os.cpus()) gave 6 workers implicitly.
* Measured on the idle runner in PR #116 (run 740, 3x each, FE-GATE-008 p50):
* 2 -> 287 s, 3 -> 244 s, 4 -> 233 s, 6 -> 238 s. No lower count beat 6 by
* >= 20 s, so 6 is pinned explicitly as a constant rather than depending on
* visible host CPUs. Not a flakiness fix: .claude/rules/tests.md 6 still holds.
*/
export const CI_PLAYWRIGHT_WORKERS = 6;
export function ciWorkers(
environment: NodeJS.ProcessEnv = process.env,
): Readonly<{ workers?: number }> {
return environment["CI"] === "true" ? Object.freeze({ workers: CI_PLAYWRIGHT_WORKERS }) : Object.freeze({});
}