From bee5bbf25e3e68658f80c41939c9c8ddffbb4f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hartmut=20N=C3=B6renberg?= Date: Mon, 13 Apr 2026 05:54:06 +0200 Subject: [PATCH] ci(docker-deploy): retry smoke run once after aggressive re-warm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Next.js dev mode on the QNAP runner intermittently drops its listening socket for ~1-2s during route-transition compiles — smoke test #2 (page.goto('/')) has hit ERR_CONNECTION_REFUSED despite both warm-ups and the immediately preceding health test succeeding. Playwright's in-process retry fires while the socket is still down. Wrap the playwright invocation in a shell-level retry: if the first full run fails, re-warm / aggressively (up to 10 probes waiting for 307) and rerun the whole suite once. --- .github/workflows/ci.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e268fd5..727413e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -620,7 +620,30 @@ jobs: - name: Run smoke tests # Use the pinned APP_BASE_URL (explicit IP) so Chromium hits the same # container as the warm-up probes. - run: PLAYWRIGHT_BASE_URL="$APP_BASE_URL" /tmp/pw-install/node_modules/.bin/playwright test --config apps/web/playwright.ci.config.ts + # + # Next.js dev mode on QNAP briefly drops the listening socket on + # route-transition compiles — test #2 (`/`) has hit ERR_CONNECTION_ + # REFUSED between a warm-up and the test even though the same URL + # returned 307 moments earlier. Playwright's in-process retry runs + # while the socket is still down. Wrap the whole playwright + # invocation in a shell retry: if the first run fails, re-warm / + # aggressively and run the full suite once more. + run: | + run_smoke() { + PLAYWRIGHT_BASE_URL="$APP_BASE_URL" \ + /tmp/pw-install/node_modules/.bin/playwright test \ + --config apps/web/playwright.ci.config.ts + } + if run_smoke; then exit 0; fi + echo "First smoke run failed — aggressive re-warm + retry" + for i in $(seq 1 10); do + CODE=$(curl -s -o /dev/null -w "%{http_code}" --max-time 30 "${APP_BASE_URL}/" || echo "000") + echo "Post-fail warm / $i: HTTP $CODE" + [ "$CODE" = "307" ] && break + sleep 3 + done + sleep 5 + run_smoke - name: Upload Playwright report if: failure()