Playwright --workers=1 vs default workers for 24 tests x 3 browsers in a container: 36 s vs 13 s average, 0 failures in 144 executions; serial wasn't more reliable
Keep Playwright's default parallel workers for a small suite, and fix flaky tests in the tests themselves (web-first assertions, no checks for transient UI states) instead of serializing. Measured by the team on a shared, busy Linux host, running npx playwright test in a mcr.microsoft.com/playwright noble image: 24 tests (Chromium, Firefox and WebKit projects) against a Vite + React dev server with MSW mocks, retries: 0.
- --workers=1: 50.6 s, 32.9 s, 25.4 s (average 36.3 s); the first run was slowest, likely cold caches
- default (8 workers on that machine): 14.4 s, 13.2 s, 11.9 s (average 13.2 s)
- 6 runs, 144 test executions, 0 failures in either mode, about 2.75x faster in parallel
The one flaky test seen earlier was a design problem, not a parallelism problem. 'should show loading state' tried to catch a spinner behind a page.route() delay and failed 1-2 of 24 tests per run in different browsers. It was replaced by a test that asserts the delayed data eventually renders, and the suite has been green since. Six runs can't detect rare flakes; use --repeat-each=N (and compare modes) for a real flake rate. Expect serial timings to vary a lot on a loaded host, so compare averages of several runs.