From 5995fdfb97e03f9c590e2b0a0f174e29a1b70ee5 Mon Sep 17 00:00:00 2001 From: rishigupta-3 Date: Mon, 4 May 2026 14:59:35 +0530 Subject: [PATCH] Fix E2E test timeout by caching Puppeteer binaries - Add Puppeteer binary cache to avoid re-downloading Chrome on every run - Increase npm ci timeout from 10m to 15m for Linux and macOS - Cache key based on package-lock.json hash for proper invalidation This fixes intermittent E2E test failures caused by Puppeteer Chrome download timing out during npm ci installation. Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/~reusable_e2e_by_OS.yaml | 24 ++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/~reusable_e2e_by_OS.yaml b/.github/workflows/~reusable_e2e_by_OS.yaml index e60f7966e..11f26094d 100644 --- a/.github/workflows/~reusable_e2e_by_OS.yaml +++ b/.github/workflows/~reusable_e2e_by_OS.yaml @@ -102,6 +102,22 @@ jobs: - uses: actions/setup-node@v3 with: node-version: ${{ inputs.NODE_VERSION }} + - name: Get Puppeteer cache directory + id: puppeteer-cache-dir + run: | + if [[ "${{ runner.os }}" == "Windows" ]]; then + echo "dir=$HOME/.cache/puppeteer" >> $GITHUB_OUTPUT + else + echo "dir=$(echo ~/.cache/puppeteer)" >> $GITHUB_OUTPUT + fi + shell: bash + - name: Cache Puppeteer binaries + uses: actions/cache@v3 + with: + path: ${{ steps.puppeteer-cache-dir.outputs.dir }} + key: ${{ runner.os }}-puppeteer-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-puppeteer- - name: Override localhost to IPv4 in Linux for Node 18 run: | sudo sed -i '/localhost/s/::1/#::1/' /etc/hosts @@ -109,17 +125,17 @@ jobs: - name: Install project dependencies (Linux) if: ${{ inputs.OS == 'ubuntu-22.04' }} run: | - echo "Starting npm ci with a 10-minute timeout" + echo "Starting npm ci with a 15-minute timeout" for i in 1 2 3; do # Retry logic, retry 3 times - timeout 10m npm ci --verbose && break || echo "npm ci failed, retrying ($i/3)..." + timeout 15m npm ci --verbose && break || echo "npm ci failed, retrying ($i/3)..." done - name: Install project dependencies (Macos) if: ${{ inputs.OS == 'macos-latest' }} run: | - echo "Starting npm ci with a 10-minute timeout" + echo "Starting npm ci with a 15-minute timeout" brew install coreutils for i in 1 2 3; do # Retry logic, retry 3 times - gtimeout 10m npm ci --verbose && break || echo "npm ci failed, retrying ($i/3)..." + gtimeout 15m npm ci --verbose && break || echo "npm ci failed, retrying ($i/3)..." done - name: Install project dependencies (Windows) if: ${{ inputs.OS == 'windows-latest' }}