Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions e2e/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export default defineConfig({
forbidOnly: !!process.env.CI,
// Retry on CI only
retries: process.env.CI ? 2 : 0,
// Opt out of parallel tests on CI.
workers: process.env.CI ? 1 : undefined,
// Parallelize tests.
workers: 10,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried using nproc to set the workers to the number of processors rather than hardcoding? e.g. when running the playwright command doing something like:

npx playwright test --workers=$(nproc)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@doshitan what do you think of this optimization? should we just hardcode it for now? seems reasonable, i think most of our laptops have 8 cores, and a quick google seems to show that github actions runners have 4 cores, so i think hardcoding to 8 seems reasonable. or if we wanted to make it more elegant we can add something to e2e/run-e2e-test to check for the number of cores like:

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
  CORES=$(nproc)
elif [[ "$OSTYPE" == "darwin"* ]]; then
  CORES=$(sysctl -n hw.ncpu)
else
  CORES=1 # Fallback to running without parallelization
fi

npx playwright test --config "${APP_NAME}/playwright.config.js" --workers=$CORES "$@"

Copy link
Contributor

@doshitan doshitan Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like by default Playwright will allocate cpu count / 2 workers. So can we just drop the explicit workers config item and use the default? Possibly set it to "100%" in CI since that environment should be more of a uni-tasker/can dedicate all it's resources to the e2e tests?

// Use 'blob' for CI to allow merging of reports. See https://playwright.dev/docs/test-reporters
reporter: process.env.CI
? [['blob']]
Expand Down