From 0b718f802514023321bfecdffa118ef206b9cd0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hartmut=20N=C3=B6renberg?= Date: Mon, 13 Apr 2026 04:21:41 +0200 Subject: [PATCH] ci: re-warm routes immediately before smoke run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The initial warm-up runs ~4 minutes before the smoke tests (seed, Node setup, Playwright install all take real time on the QNAP runner). Between those steps, Next.js dev server can evict or recompile routes under memory pressure — test #2 kept hitting ERR_CONNECTION_REFUSED on / (139ms, consistently) while /auth/signin, login, and authed nav all passed cleanly in the same run. Re-warm both routes right before Playwright starts so the server is guaranteed hot at the moment smoke test #2 navigates. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7729818..5f1fe90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -587,6 +587,29 @@ jobs: ln -sfn /tmp/pw-install/node_modules/playwright-core apps/web/node_modules/playwright-core /tmp/pw-install/node_modules/.bin/playwright install chromium --with-deps + - name: Re-warm routes immediately before smoke run + # The earlier warm-up runs ~4 minutes before the smoke tests (seed, + # Node setup, Playwright install all take real time on QNAP). In + # between, the Next.js dev server on a constrained host can evict + # or recompile routes under memory pressure — test #2 kept hitting + # ERR_CONNECTION_REFUSED on / while tests for /auth/signin and api + # routes worked fine. Re-warm both routes (same IP pin) just + # before Playwright starts so the server is guaranteed hot. + run: | + warm() { + local path="$1" + local expect="$2" + for i in $(seq 1 24); do + CODE=$(curl -s -o /dev/null -w "%{http_code}" --max-time 30 "${APP_BASE_URL}${path}" || echo "000") + echo "Re-warm ${path} $i: HTTP $CODE" + if [ "$CODE" = "$expect" ]; then return 0; fi + sleep 3 + done + echo "Re-warm ${path} did not reach $expect; continuing anyway" + } + warm / 307 + warm /auth/signin 200 + - name: Run smoke tests # Use the pinned APP_BASE_URL (explicit IP) so Chromium hits the same # container as the warm-up probes.