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.