ci(docker): allow cold-start healthcheck window

This commit is contained in:
Tam Nhu Tran committed 2026-08-09 00:09:52 -04:00
1 parent f8a9518b17
commit 78ad297e30
1 file changed
+4 -4
+4 -4
View File
@@ -373,9 +373,9 @@ jobs:
sh -c 'tail -n 100 /var/log/ccs/ccs-dashboard.log' >&2 || true sh -c 'tail -n 100 /var/log/ccs/ccs-dashboard.log' >&2 || true
} }
echo "[i] Waiting for container healthcheck (up to 60s)..." echo "[i] Waiting for container healthcheck (up to 180s)..."
HEALTHY=0 HEALTHY=0
for i in $(seq 1 12); do for i in $(seq 1 36); do
STATUS=$(docker inspect "${CONTAINER_NAME}" --format='{{.State.Health.Status}}' 2>/dev/null || echo "missing") STATUS=$(docker inspect "${CONTAINER_NAME}" --format='{{.State.Health.Status}}' 2>/dev/null || echo "missing")
if [[ "${STATUS}" == "healthy" ]]; then if [[ "${STATUS}" == "healthy" ]]; then
echo "[OK] Container is healthy after $((i * 5))s" echo "[OK] Container is healthy after $((i * 5))s"
@@ -387,11 +387,11 @@ jobs:
print_service_logs print_service_logs
exit 1 exit 1
fi fi
echo " [${i}/12] status=${STATUS}, waiting 5s..." echo " [${i}/36] status=${STATUS}, waiting 5s..."
sleep 5 sleep 5
done done
if [[ "${HEALTHY}" -ne 1 ]]; then if [[ "${HEALTHY}" -ne 1 ]]; then
echo "[X] Container did not become healthy within 60s (last status: ${STATUS})" >&2 echo "[X] Container did not become healthy within 180s (last status: ${STATUS})" >&2
print_service_logs print_service_logs
docker inspect "${CONTAINER_NAME}" --format='{{json .State}}' >&2 || true docker inspect "${CONTAINER_NAME}" --format='{{json .State}}' >&2 || true
exit 1 exit 1