From 3c28fe656d1a2bc4f67d6fe2f016e058b1cd5e24 Mon Sep 17 00:00:00 2001 From: NorD Date: Sun, 1 Nov 2026 01:36:54 +0300 Subject: [PATCH] fix(test): wait for /readyz to settle in smoke-test.sh --- scripts/smoke-test.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/smoke-test.sh b/scripts/smoke-test.sh index d38b3d5..2022169 100644 --- a/scripts/smoke-test.sh +++ b/scripts/smoke-test.sh @@ -49,17 +49,27 @@ wait_healthz() { return 1 } +wait_readyz() { + for _ in $(seq 1 30); do + code="$(curl -sS -o /dev/null -w '%{http_code}' "${base}/readyz" 2>/dev/null || echo 000)" + if [ "${code}" = "200" ]; then return 0; fi + sleep 1 + done + return 1 +} + echo "[smoke] waiting for /healthz on ${base}" wait_healthz || { echo "[smoke] FATAL: /healthz never became ready" >&2; docker logs "${CTR}" >&2 || true; exit 1; } echo "[smoke] PASS /healthz" -echo "[smoke] checking /readyz" -code="$(curl -sS -o /dev/null -w '%{http_code}' "${base}/readyz")" -if [ "${code}" != "200" ]; then - echo "[smoke] FATAL: /readyz returned ${code} (expected 200)" >&2 +echo "[smoke] waiting for /readyz on ${base}" +wait_readyz || { + code="$(curl -sS -o /dev/null -w '%{http_code}' "${base}/readyz" 2>/dev/null || echo 000)" + echo "[smoke] FATAL: /readyz returned ${code} after wait (expected 200)" >&2 + curl -sS "${base}/readyz" >&2 || true docker logs "${CTR}" >&2 || true exit 1 -fi +} echo "[smoke] PASS /readyz" echo "[smoke] checking negative auth: /v1/catalog without credentials must be rejected"