From 6f05f2427ba635eb4101253d9ccfa68313595489 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 14 Aug 2026 20:35:37 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20ci:=20Stop=20Optional=20Playwrig?= =?UTF-8?q?ht=20Fonts=20From=20Failing=20E2E=20(#14852)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `npx playwright install-deps chrome` is the third-most-common e2e failure: three of the last twenty-five Playwright runs died on it, taking the whole aggregate gate with them. The step is not installing anything CI needs. The runner's Chrome is an apt package, so apt has already satisfied every library Playwright lists — the log shows each one "already the newest version". All `install-deps` adds are decorative CJK/Thai/Cyrillic font packages, ~21MB pulled from azure.archive.ubuntu.com by seven jobs on every PR. No CI assertion depends on them: the only spec that screenshots gates its comparison behind `E2E_VISUAL_SNAPSHOTS`, which no workflow sets, and no baselines are committed. Keep the install, but demote it. `google-chrome --version` becomes its own fatal step so a genuinely missing browser still fails loudly and immediately, while the font install retries with a per-attempt cap and degrades to a warning. The Redis install in the list_changed job stays fatal — that one is required. --- .github/scripts/install-playwright-fonts.sh | 30 ++++++++++++++++++++ .github/workflows/playwright-bombadil.yml | 13 +++++---- .github/workflows/playwright-mock.yml | 31 +++++++++++++++------ 3 files changed, 61 insertions(+), 13 deletions(-) create mode 100755 .github/scripts/install-playwright-fonts.sh diff --git a/.github/scripts/install-playwright-fonts.sh b/.github/scripts/install-playwright-fonts.sh new file mode 100755 index 0000000000..ada4fa5537 --- /dev/null +++ b/.github/scripts/install-playwright-fonts.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# +# Installs Playwright's optional font packages for the `chrome` channel. +# +# The GitHub runner ships Chrome as an apt package, so every library Playwright +# lists is already satisfied by apt itself. The only packages `install-deps` adds +# are decorative CJK/Thai/Cyrillic fonts (~21MB) that no CI assertion depends on: +# the one spec that takes screenshots gates the comparison behind +# `E2E_VISUAL_SNAPSHOTS`, which CI never sets. +# +# Ubuntu's mirrors stall often enough that a hard failure here has repeatedly +# taken down whole e2e runs, so each attempt is capped and a final failure is +# only a warning. The workflow keeps `continue-on-error: true` as a backstop for +# the case where the step itself is killed by its timeout. + +set -uo pipefail + +readonly ATTEMPT_TIMEOUT_SECONDS=70 +readonly MAX_ATTEMPTS=3 + +for attempt in $(seq 1 "${MAX_ATTEMPTS}"); do + if timeout "${ATTEMPT_TIMEOUT_SECONDS}" npx playwright install-deps chrome; then + exit 0 + fi + echo "::warning::playwright install-deps attempt ${attempt}/${MAX_ATTEMPTS} failed or timed out" + sleep 5 +done + +echo "::warning::Optional Playwright font packages were not installed; continuing without them." +exit 0 diff --git a/.github/workflows/playwright-bombadil.yml b/.github/workflows/playwright-bombadil.yml index 58d28b9884..064a3141dc 100644 --- a/.github/workflows/playwright-bombadil.yml +++ b/.github/workflows/playwright-bombadil.yml @@ -119,11 +119,14 @@ jobs: if: steps.cache-client-app.outputs.cache-hit != 'true' run: npm run build:client - - name: Install Playwright runtime dependencies - timeout-minutes: 5 - run: | - google-chrome --version - npx playwright install-deps chrome + - name: Verify Chrome is present + run: google-chrome --version + + # Optional fonts only — see the note in playwright-mock.yml's e2e_shards job. + - name: Install optional Playwright font dependencies (best effort) + timeout-minutes: 4 + continue-on-error: true + run: .github/scripts/install-playwright-fonts.sh - name: Run five-minute Bombadil exploration id: bombadil diff --git a/.github/workflows/playwright-mock.yml b/.github/workflows/playwright-mock.yml index d764961d0d..3baae0e307 100644 --- a/.github/workflows/playwright-mock.yml +++ b/.github/workflows/playwright-mock.yml @@ -141,11 +141,18 @@ jobs: if: steps.cache-client-app.outputs.cache-hit != 'true' run: npm run build:client - - name: Install Playwright runtime dependencies - timeout-minutes: 5 - run: | - google-chrome --version - npx playwright install-deps chrome + - name: Verify Chrome is present + run: google-chrome --version + + # The runner's Chrome is an apt package, so its real library dependencies are + # already satisfied; all `install-deps` adds here are optional CJK/Thai/Cyrillic + # font packages (~21MB from azure.archive.ubuntu.com). Nothing in CI asserts on + # them — visual baselines are opt-in via E2E_VISUAL_SNAPSHOTS — so a stalled + # Ubuntu mirror must never be able to fail the suite. + - name: Install optional Playwright font dependencies (best effort) + timeout-minutes: 4 + continue-on-error: true + run: .github/scripts/install-playwright-fonts.sh - name: Run full mock-LLM Tier-1 e2e if: matrix.suite == 'full' @@ -225,11 +232,19 @@ jobs: - name: Build e2e dependencies run: npm run e2e:prepare - - name: Install Playwright and Redis runtime dependencies + - name: Verify Chrome is present + run: google-chrome --version + + # Optional fonts only — see the note in the e2e_shards job. + - name: Install optional Playwright font dependencies (best effort) + timeout-minutes: 4 + continue-on-error: true + run: .github/scripts/install-playwright-fonts.sh + + # Redis is a hard requirement for this job, so this step stays fatal. + - name: Install Redis runtime dependencies timeout-minutes: 5 run: | - google-chrome --version - npx playwright install-deps chrome sudo apt-get update sudo apt-get install -y redis-server redis-tools