test(web): cap Playwright workers to stop full-suite contention flakes #1069
Loading…
Reference in a new issue
No description provided.
Delete branch "test/pw-worker-tuning"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Evidence:
nproc= 8 and Playwright's defaultworkersis50%of cores (playwright/lib/common/config.js), so the full suite ran at 4 workers on this host — measured from the run log ("Running 862 tests using 4 workers"). At those settings the full suite flaked: 47 failed / 16 flaky / 776 passed in 9.2m, spread across unrelated specs, while every failing spec passes in isolation (e.g. upload-status 12/12 alone, profile-tabs 36/36 alone) andretries: 2did not absorb them — i.e. contention on the shared dev host, not product bugs. A candidate cap ofmin(cpus, 6)= 6 was rejected from measurement because it would have raised concurrency above the setting that failed.Fix: explicit
workers = min(floor(cpus/2), 4)— identical to today's default on ≤8-core hosts, and a hard bound on bigger machines where the 50% default would spawn 8–16 workers and saturate them.fullyParallel: truekept (we cap concurrency, we do not serialize files); no spec files,retries, webServer/port logic, or projects touched.Verification (full suite
npm test, 862 tests / desktop+mobile): baseline at the previous settings — 0 failed / 0 flaky / 839 passed / 23 skipped in 5.8m (flake is load-dependent; host was idle). After the cap, two consecutive clean full runs: 837 passed, 0 failed, 2 flaky absorbed by retries (7.4m) and 832 passed, 0 failed, 7 flaky absorbed by retries (11.2m).CI:
.forgejo/workflows/runsnpm run testwith no--workersflag, the Playwright image does not exportCI, and no CPU limit is set on the web-test container — so no CI override conflicts; CI inherits the same expression (unchanged vs today's 50% default on ≤8-core runners, capped at 4 on larger ones).