From 22383bf803d2adc1c6e74f9afab533a9be6b1a59 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Mon, 19 Oct 2026 12:53:40 +0200 Subject: [PATCH 1/3] ci(e2e): Stop pnpm run from installing the workspace in E2E jobs Since #25403, E2E jobs no longer restore the root node_modules. pnpm then installs the whole workspace before the first `pnpm run` in dev-packages/e2e-tests, which took about 26s per job. Next to the background Playwright install, its npx sometimes picked up the half-installed root playwright and failed with "playwright: not found". Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c3267dedc200..0689c54a3a6a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1060,6 +1060,8 @@ jobs: E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests' # The `runtime` of a runtime variant, see dev-packages/e2e-tests/README.md RUNTIME: ${{ matrix.runtime }} + # Without the root node_modules, `pnpm run` would first install the whole workspace. + pnpm_config_verify_deps_before_run: 'false' strategy: fail-fast: false matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix) }} @@ -1206,6 +1208,8 @@ jobs: CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} # The `runtime` of a runtime variant, see dev-packages/e2e-tests/README.md RUNTIME: ${{ matrix.runtime }} + # Without the root node_modules, `pnpm run` would first install the whole workspace. + pnpm_config_verify_deps_before_run: 'false' strategy: fail-fast: false matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix-optional) }} From 9d24260bf0164efc9dda156ef389bc1b37844612 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Mon, 19 Oct 2026 16:14:48 +0200 Subject: [PATCH 2/3] ci(e2e): Install Playwright in a plain background step A background composite action sets up its steps from the job's shared github context. When a foreground step starts at that moment, the runner fails with "Collection was modified; enumeration operation may not execute". With the workspace install gone, the foreground steps start quickly enough to hit this in a few jobs per run. The E2E jobs only need chromium, so download it directly instead of restoring the cache of all browsers. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0689c54a3a6a..dae1ab9d3c5a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1123,13 +1123,17 @@ jobs: # Installs Playwright while the app builds. # Started after the artifact downloads: starting next to them made `download-artifact` fail to read the event file. + # Not the `install-playwright` action: the runner sets up a background composite action's steps from the job's + # shared `github` context, which fails with "Collection was modified" when a foreground step starts at that moment. - name: Install Playwright id: install-playwright background: true - uses: ./.github/actions/install-playwright - with: - browsers: chromium - cwd: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }} + working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }} + run: | + version=$(node -p "const { dependencies, devDependencies } = require('./package.json'); (devDependencies?.['@playwright/test'] ?? dependencies?.['@playwright/test'] ?? '').replace(/^[~^=]/, '')") + if [ -n "$version" ]; then + npx -y "playwright@$version" install --with-deps chromium + fi - name: Prepare e2e tests run: pnpm run test:prepare @@ -1252,13 +1256,17 @@ jobs: # Installs Playwright while the app builds. # Started after the artifact downloads: starting next to them made `download-artifact` fail to read the event file. + # Not the `install-playwright` action: the runner sets up a background composite action's steps from the job's + # shared `github` context, which fails with "Collection was modified" when a foreground step starts at that moment. - name: Install Playwright id: install-playwright background: true - uses: ./.github/actions/install-playwright - with: - browsers: chromium - cwd: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }} + working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }} + run: | + version=$(node -p "const { dependencies, devDependencies } = require('./package.json'); (devDependencies?.['@playwright/test'] ?? dependencies?.['@playwright/test'] ?? '').replace(/^[~^=]/, '')") + if [ -n "$version" ]; then + npx -y "playwright@$version" install --with-deps chromium + fi - name: Prepare E2E tests run: pnpm run test:prepare From 0560e3098bdd0eeccccde4d594566605c55070b0 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Mon, 19 Oct 2026 16:17:17 +0200 Subject: [PATCH 3/3] ci(e2e): Use the install-playwright action again, started right before the build Instead of replacing the action, start it where the next foreground step runs for a while. Without the workspace install, the steps before the build take well under a second, so this barely shortens the overlap. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yml | 50 ++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dae1ab9d3c5a..ce53bcc737e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1121,20 +1121,6 @@ jobs: with: name: build-output - # Installs Playwright while the app builds. - # Started after the artifact downloads: starting next to them made `download-artifact` fail to read the event file. - # Not the `install-playwright` action: the runner sets up a background composite action's steps from the job's - # shared `github` context, which fails with "Collection was modified" when a foreground step starts at that moment. - - name: Install Playwright - id: install-playwright - background: true - working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }} - run: | - version=$(node -p "const { dependencies, devDependencies } = require('./package.json'); (devDependencies?.['@playwright/test'] ?? dependencies?.['@playwright/test'] ?? '').replace(/^[~^=]/, '')") - if [ -n "$version" ]; then - npx -y "playwright@$version" install --with-deps chromium - fi - - name: Prepare e2e tests run: pnpm run test:prepare working-directory: dev-packages/e2e-tests @@ -1155,6 +1141,17 @@ jobs: }}/dev-packages/e2e-tests/packed working-directory: dev-packages/e2e-tests + # Installs Playwright while the app builds. Keep it right before the build: the runner sets up a background + # composite action's steps from the job's shared `github` context, which fails with "Collection was modified" if + # a foreground step starts at that moment. Starting next to `download-artifact` also made it fail to read the event file. + - name: Install Playwright + id: install-playwright + background: true + uses: ./.github/actions/install-playwright + with: + browsers: chromium + cwd: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }} + - name: Build E2E app working-directory: ${{ runner.temp }}/test-application timeout-minutes: 7 @@ -1254,20 +1251,6 @@ jobs: name: build-test-utils-tarball-output path: dev-packages/test-utils - # Installs Playwright while the app builds. - # Started after the artifact downloads: starting next to them made `download-artifact` fail to read the event file. - # Not the `install-playwright` action: the runner sets up a background composite action's steps from the job's - # shared `github` context, which fails with "Collection was modified" when a foreground step starts at that moment. - - name: Install Playwright - id: install-playwright - background: true - working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }} - run: | - version=$(node -p "const { dependencies, devDependencies } = require('./package.json'); (devDependencies?.['@playwright/test'] ?? dependencies?.['@playwright/test'] ?? '').replace(/^[~^=]/, '')") - if [ -n "$version" ]; then - npx -y "playwright@$version" install --with-deps chromium - fi - - name: Prepare E2E tests run: pnpm run test:prepare working-directory: dev-packages/e2e-tests @@ -1288,6 +1271,17 @@ jobs: }}/dev-packages/e2e-tests/packed working-directory: dev-packages/e2e-tests + # Installs Playwright while the app builds. Keep it right before the build: the runner sets up a background + # composite action's steps from the job's shared `github` context, which fails with "Collection was modified" if + # a foreground step starts at that moment. Starting next to `download-artifact` also made it fail to read the event file. + - name: Install Playwright + id: install-playwright + background: true + uses: ./.github/actions/install-playwright + with: + browsers: chromium + cwd: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }} + - name: Build E2E app working-directory: ${{ runner.temp }}/test-application timeout-minutes: 7