Skip to content

Make the browser tests faster on CI - #577

Merged
CodeByZach merged 2 commits into
candidate-2.0from
parallel-tests
Nov 11, 2026
Merged

CodeByZach merged 2 commits into
candidate-2.0from
parallel-tests

Conversation

@CodeByZach

@CodeByZach CodeByZach commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Makes the browser tests much faster on CI.

  • Parallel tests: the tests run in parallel, also within a file, with one worker per CPU core on CI instead of one in all. They mostly wait for pace's timers and for the requests they send, so they don't compete for the CPU (one worker used about 17% of it). The tests share no state, and each worker has its own local server.
  • Playwright's container image: the browser jobs run in Playwright's own image (mcr.microsoft.com/playwright, as in Playwright's CI docs), which comes with the browsers and the system packages they need. Before, each job installed them from Ubuntu's servers, which took 1.5 to 2.5 minutes and sometimes hung until the time limit. The image is pinned to the version of @playwright/test and by digest.

Each browser job now takes about 1.5 minutes instead of about 3 to 6.

Running in parallel doesn't change what the tests catch: 34 deliberately broken versions of pace.js were caught by exactly the same tests with one worker and with four.

The tests spend their time waiting for pace's timers (restartOnRequestAfter,
minTime, ghostTime) and for the requests they send, not on the CPU: one
worker used about 17% of it. So every test now runs in parallel, also
within a file, and CI uses one worker per CPU core instead of one in all.
The tests share no state, and each worker has its own local server.
Each browser job installed its browser and the system packages it needs
from Ubuntu's servers, which took 1.5 to 2.5 minutes and sometimes hung
until the job's time limit. The jobs now run in Playwright's own image
(mcr.microsoft.com/playwright, the setup Playwright's CI docs describe),
which has both, so a job starts testing after about 20 seconds. The image
is pinned to the version of @playwright/test and by digest, and the job's
time limit drops from 10 to 5 minutes.
@CodeByZach CodeByZach changed the title Run the browser tests in parallel Make the browser tests faster on CI Nov 11, 2026
@CodeByZach
CodeByZach merged commit 08ddec9 into candidate-2.0 Nov 11, 2026
18 checks passed
@CodeByZach
CodeByZach deleted the parallel-tests branch November 11, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant