From 177d9e0f9a49312421c57f6630aee1fde034ff92 Mon Sep 17 00:00:00 2001 From: chemavx Date: Wed, 20 May 2026 14:14:40 +0000 Subject: [PATCH] fix: retry loop up to 60s in n8n smoke test healthz check Co-Authored-By: Claude Sonnet 4.6 --- n8n/postsync-smoke-test.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/n8n/postsync-smoke-test.yaml b/n8n/postsync-smoke-test.yaml index 1a274db..7ed8c82 100644 --- a/n8n/postsync-smoke-test.yaml +++ b/n8n/postsync-smoke-test.yaml @@ -46,11 +46,15 @@ spec: } echo "--- [1/1] GET /healthz ---" - HEALTH=$(curl -sf --max-time 15 --retry 3 --retry-delay 5 --retry-all-errors \ - "$BASE/healthz") || fail "GET /healthz unreachable" - echo "$HEALTH" - echo "$HEALTH" | grep -qF '"status":"ok"' \ - || fail "health response missing status:ok" + RESULT="" + for i in $(seq 1 12); do + RESULT=$(curl -sf --max-time 10 "$BASE/healthz" 2>/dev/null) && break + echo "Waiting... (attempt $i/12)" + sleep 5 + done + [ -n "$RESULT" ] || fail "GET /healthz unreachable after 60s" + echo "$RESULT" + echo "$RESULT" | grep -qF '"status":"ok"' || fail "healthz did not return status ok" echo "OK" notify "[OK] n8n PostSync passed"