From 6895d84f02b57b8ceee81d8b5bf5cea01f4ce618 Mon Sep 17 00:00:00 2001 From: ScriptedAlchemy Date: Fri, 13 Nov 2026 16:49:12 -0800 Subject: [PATCH] fix(ci): shard fork web tests so Chromium stops closing mid-run Fork CI ran all 588 web browser test files in one headless Chromium on a standard runner. It ran out of memory and closed partway through, failing main and every PR on a different file each time. Upstream already shards this suite; fork CI now does too, across four runners. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/fork-ci.yml | 39 ++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/.github/workflows/fork-ci.yml b/.github/workflows/fork-ci.yml index 6a318bc7228cd..a83f0fac7fb57 100644 --- a/.github/workflows/fork-ci.yml +++ b/.github/workflows/fork-ci.yml @@ -102,7 +102,7 @@ jobs: clients: name: Client and package tests needs: changes - if: needs.changes.outputs.test != 'false' || needs.changes.outputs.test_web != 'false' + if: needs.changes.outputs.test != 'false' runs-on: ubuntu-24.04 timeout-minutes: 45 steps: @@ -121,9 +121,6 @@ jobs: - uses: ./.github/actions/setup-ci-deps - name: Ensure Electron run: vp run --filter @t3tools/desktop ensure:electron - - name: Install Chromium - if: needs.changes.outputs.test_web != 'false' - run: node apps/web/node_modules/playwright/cli.js install --with-deps --only-shell chromium - name: Test release checks run: | python3 -B .github/scripts/stage-preview-bundle.test.py @@ -139,9 +136,35 @@ jobs: for package in $TEST_PACKAGES; do filters+=(--filter "$package"); done fi vp run --parallel --concurrency-limit 2 "${filters[@]}" test + + # One headless Chromium running every browser test file runs out of memory on a + # standard runner and closes mid-run, so the files are split across machines. + web: + name: Web tests ${{ matrix.shard }} + needs: changes + if: needs.changes.outputs.test_web != 'false' + runs-on: ubuntu-24.04 + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + shard: [1, 2, 3, 4] + steps: + - name: Checkout + env: + GIT_TERMINAL_PROMPT: "0" + run: | + git init . + git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" + git fetch --no-tags --depth=2 origin "$GITHUB_SHA" + git sparse-checkout set --no-cone '/*' '!/.repos/' '!/apps/mobile/modules/t3-terminal/Vendor/**/*.a' + git checkout --detach FETCH_HEAD + - uses: ./.github/actions/setup-apt-mirrors + - uses: ./.github/actions/setup-ci-deps + - name: Install Chromium + run: node apps/web/node_modules/playwright/cli.js install --with-deps --only-shell chromium - name: Test web - if: needs.changes.outputs.test_web != 'false' - run: vp run --filter @t3tools/web test + run: vp run --filter @t3tools/web test --shard ${{ matrix.shard }}/${{ strategy.job-total }} server: name: Server tests ${{ matrix.shard }} @@ -232,7 +255,7 @@ jobs: check: name: Fork Check if: ${{ !cancelled() && github.repository != 'pingdotgg/t3code' }} - needs: [changes, checks, clients, server, rust, mobile_native] + needs: [changes, checks, clients, web, server, rust, mobile_native] runs-on: ubuntu-24.04 timeout-minutes: 5 steps: @@ -242,7 +265,7 @@ jobs: run: | echo "$RESULTS" | jq -r 'to_entries[] | "\(.key): \(.value.result)"' echo "$RESULTS" | jq -e '.changes.outputs as $gates - | {clients: ["test", "test_web"], server: ["test_server"]} as $renamed + | {clients: ["test"], web: ["test_web"], server: ["test_server"]} as $renamed | all(to_entries[]; .value.result == "success" or (.value.result == "skipped"