fix: increase staging health check timeout to 4 minutes (refs #64)
Some checks failed
Deploy to Staging / Build Images (pull_request) Successful in 30s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 31s
Deploy to Staging / Verify Staging (pull_request) Failing after 1m28s
Deploy to Staging / Notify Staging Ready (pull_request) Has been skipped
Deploy to Staging / Notify Staging Failure (pull_request) Successful in 7s
Some checks failed
Deploy to Staging / Build Images (pull_request) Successful in 30s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 31s
Deploy to Staging / Verify Staging (pull_request) Failing after 1m28s
Deploy to Staging / Notify Staging Ready (pull_request) Has been skipped
Deploy to Staging / Notify Staging Failure (pull_request) Successful in 7s
Backend with fresh migrations can take ~3 minutes to start. Increased from 10x5s (50s) to 24x10s (240s) to accommodate. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -198,7 +198,8 @@ jobs:
|
|||||||
# Check if service has a healthcheck defined
|
# Check if service has a healthcheck defined
|
||||||
has_healthcheck=$(docker inspect --format='{{if .Config.Healthcheck}}true{{else}}false{{end}}' $service 2>/dev/null || echo "false")
|
has_healthcheck=$(docker inspect --format='{{if .Config.Healthcheck}}true{{else}}false{{end}}' $service 2>/dev/null || echo "false")
|
||||||
if [ "$has_healthcheck" = "true" ]; then
|
if [ "$has_healthcheck" = "true" ]; then
|
||||||
for i in 1 2 3 4 5 6 7 8 9 10; do
|
# 24 attempts x 10 seconds = 4 minutes max wait (backend with fresh migrations can take ~3 min)
|
||||||
|
for i in $(seq 1 24); do
|
||||||
health=$(docker inspect --format='{{.State.Health.Status}}' $service 2>/dev/null || echo "unknown")
|
health=$(docker inspect --format='{{.State.Health.Status}}' $service 2>/dev/null || echo "unknown")
|
||||||
if [ "$health" = "healthy" ]; then
|
if [ "$health" = "healthy" ]; then
|
||||||
echo "OK: $service is healthy"
|
echo "OK: $service is healthy"
|
||||||
@@ -208,13 +209,13 @@ jobs:
|
|||||||
docker logs $service --tail 50 2>/dev/null || true
|
docker logs $service --tail 50 2>/dev/null || true
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ $i -eq 10 ]; then
|
if [ $i -eq 24 ]; then
|
||||||
echo "ERROR: $service health check timed out (status: $health)"
|
echo "ERROR: $service health check timed out (status: $health)"
|
||||||
docker logs $service --tail 50 2>/dev/null || true
|
docker logs $service --tail 50 2>/dev/null || true
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "Waiting for $service healthcheck... (attempt $i/10, status: $health)"
|
echo "Waiting for $service healthcheck... (attempt $i/24, status: $health)"
|
||||||
sleep 5
|
sleep 10
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
echo "SKIP: $service has no healthcheck defined"
|
echo "SKIP: $service has no healthcheck defined"
|
||||||
|
|||||||
Reference in New Issue
Block a user