From 670a1247dbed8121cf7ef7dc93cd3d5b7f5e1f62 Mon Sep 17 00:00:00 2001 From: Gage Krumbach Date: Thu, 22 Oct 2026 08:19:17 -0500 Subject: [PATCH] ci(e2e): start the dev server and wait for it before Cypress runs From 2026-10-22 every e2e run failed before a test ran, on main as well (a83a4cc): the Cypress action's wait-on gave up on its first refused connection ("Socket closed before the connection was established") instead of retrying, before Vite had printed a line. Nothing in the repository had changed; the runner image and the action's SHA were the same as in the last passing run. The job now builds, starts the dev server in the background and waits for it with curl, printing Vite's log when it does not come up, and then runs Cypress against it with the action's install and wait left out. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4fd38fdc..27f85ff6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,13 +111,29 @@ jobs: cache: "npm" cache-dependency-path: frontend/package-lock.json - run: cd frontend && npm ci + - run: cd frontend && npm run build + # The dev server is started and waited for here, not by the Cypress + # action: from 2026-10-22 the action's wait-on gave up on its first + # refused connection ("Socket closed before the connection was + # established") instead of retrying, before Vite had printed a line. + - name: Start the dev server + run: | + cd frontend + nohup npm start > "$RUNNER_TEMP/vite.log" 2>&1 & + for i in $(seq 1 60); do + if curl -sf -o /dev/null http://localhost:3000; then exit 0; fi + sleep 1 + done + echo "The dev server did not answer on :3000 within 60 s." + cat "$RUNNER_TEMP/vite.log" + exit 1 - uses: cypress-io/github-action@v6 with: working-directory: frontend - build: npm run build - start: npm start - wait-on: "http://localhost:3000" + install: false browser: chrome + - if: failure() + run: cat "$RUNNER_TEMP/vite.log" || true - uses: actions/upload-artifact@v4 if: failure() with: