From ce1a95ace120462033460a554cc3362317c732b7 Mon Sep 17 00:00:00 2001 From: serversidehannes Date: Mon, 8 Jun 2026 17:32:30 +0200 Subject: [PATCH] fix(ci): wait for front proxy to discover a backend before round-trip The Helm install test's front-proxy step fired its one-shot S3 round-trip the moment the HAProxy pods reported Ready. But HAProxy starts with no backend addresses (server-template + init-addr none) and only populates its server slots once it resolves the headless Service via DNS, which in turn publishes app pod IPs only after they pass readiness. During that warm-up window every request is 503 , so the test failed intermittently. Poll the proxy with a read-only `s3 ls` until a live backend responds before asserting the round-trip. --- .github/workflows/helm-install-test.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/helm-install-test.yml b/.github/workflows/helm-install-test.yml index 63c7646..d25d257 100644 --- a/.github/workflows/helm-install-test.yml +++ b/.github/workflows/helm-install-test.yml @@ -138,6 +138,22 @@ jobs: --command -- /bin/sh -c ' set -e ENDPOINT="http://s3proxy-python-frontproxy:80" + + # HAProxy starts with no backend addresses (server-template + init-addr none) + # and only fills its server slots once it resolves the headless Service via DNS, + # which publishes pod IPs only after the app pods are Ready. Until that first + # resolution lands, every request is 503 . Wait for a live backend before + # asserting the round-trip. + echo "Waiting for the front proxy to discover a backend..." + for i in $(seq 1 30); do + if aws --endpoint-url $ENDPOINT s3 ls >/dev/null 2>&1; then + echo "Backend is live (attempt $i)" + break + fi + [ "$i" = "30" ] && { echo "✗ front proxy never reached a live backend"; exit 1; } + sleep 2 + done + echo "via front proxy - $(date)" > /tmp/fp.txt ORIG=$(md5sum /tmp/fp.txt | cut -c1-32) aws --endpoint-url $ENDPOINT s3 mb s3://frontproxy-bucket