Repository navigation
Make the browser tests faster on CI - #577
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the browser tests much faster on CI.
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/testand 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.jswere caught by exactly the same tests with one worker and with four.