From 87ec7efd0fa7bdbed22c1c0c67d671907029d7bb Mon Sep 17 00:00:00 2001 From: Mikhail Date: Sun, 30 Aug 2026 13:10:38 +0300 Subject: [PATCH] fix: allow bounded candidate startup discovery --- deploy/run-production-canary.sh | 3 ++- tests/deployment/stable-release-set-guard_test.sh | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/deploy/run-production-canary.sh b/deploy/run-production-canary.sh index ce0a452..0c89b0f 100644 --- a/deploy/run-production-canary.sh +++ b/deploy/run-production-canary.sh @@ -6,6 +6,7 @@ ENV_FILE="${ENV_FILE:-/home/m/assistant-deploy/production-compose.env}" COMPOSE_FILE="$BASE_DIR/deploy/docker-compose.prod.yml" SUPERVISOR_CONTROL_URL="${SUPERVISOR_CONTROL_URL:-http://127.0.0.1:${SUPERVISOR_CONTROL_PORT:-18085}}" REVISION="${1:?candidate revision is required}" +HEALTH_ATTEMPTS="${HEALTH_ATTEMPTS:-360}" set -a . "$ENV_FILE" @@ -51,7 +52,7 @@ compose --profile assistant-canary build --build-arg "SOURCE_REVISION=$REVISION" wait_healthy() { local container="$1" status="" ready="" ready="" - for attempt in $(seq 1 60); do + for attempt in $(seq 1 "$HEALTH_ATTEMPTS"); do status=$(docker inspect -f '{{if .State.Health}}{{.State.Health.Status}}{{else}}unknown{{end}}' "$container" 2>/dev/null || true) if [[ "$status" == healthy ]]; then ready=true; break; fi sleep 2 diff --git a/tests/deployment/stable-release-set-guard_test.sh b/tests/deployment/stable-release-set-guard_test.sh index bc71253..9916590 100644 --- a/tests/deployment/stable-release-set-guard_test.sh +++ b/tests/deployment/stable-release-set-guard_test.sh @@ -14,4 +14,6 @@ grep -Fq 'assert_stable_ids_unchanged' "$canary" grep -Fq 'before=$(stable_ids)' "$supervisor" grep -Fq 'after=$(stable_ids)' "$supervisor" grep -Fq 'stable container IDs changed' "$supervisor" +grep -Fq 'HEALTH_ATTEMPTS="${HEALTH_ATTEMPTS:-360}"' "$canary" +grep -Fq 'seq 1 "$HEALTH_ATTEMPTS"' "$canary" echo 'stable release-set guard: PASS'