Skip to content

Commit 55bbd3e

Browse files
committed
ci: wait out the restart window before asking PHP over HTTP
forge restart brings Apache back before the PHP containers finish their entrypoint, and a proxy into that window answers 503. The CLI assertions above it passed, so the settings were right and only the timing was wrong -- the same lesson the 'start the stack' step already carries. Reproduced locally by curling immediately after a restart: attempts one and two fail, the third answers.
1 parent 0c15028 commit 55bbd3e

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,13 +394,22 @@ jobs:
394394
got="$(docker compose exec -T php83dev php -r 'echo ini_get("memory_limit");')"
395395
test "$got" = 444M || { echo "php83dev: expected its own 444M, got $got"; exit 1; }
396396
397-
# and FPM, not just the CLI: the mount is what the request goes through
397+
# and FPM, not just the CLI: the mount is what the request goes through.
398+
# Retried, because the restart above answers on port 443 before the PHP
399+
# containers finish their entrypoint -- Apache proxies into that window
400+
# and returns 503, which is what "started" not meaning "ready" looks like.
398401
DIR="$(grep '^PROJECTS_DIR=' .env | cut -d= -f2-)"
399402
printf '<?php echo ini_get("memory_limit");' > "$DIR/sites/my-app/limit.php"
400403
host=my-app--sites--p83.phpforge.dev
401-
got="$(curl -fsSk --resolve "$host:443:127.0.0.1" "https://$host/limit.php")"
404+
got=""
405+
for i in $(seq 1 30); do
406+
got="$(curl -fsSk --max-time 5 --resolve "$host:443:127.0.0.1" \
407+
"https://$host/limit.php" 2>/dev/null || true)"
408+
[ -n "$got" ] && break
409+
sleep 1
410+
done
402411
rm -f "$DIR/sites/my-app/limit.php"
403-
test "$got" = 444M || { echo "over http: expected 444M, got $got"; exit 1; }
412+
test "$got" = 444M || { echo "over http: expected 444M, got '$got'"; exit 1; }
404413
405414
echo "shared settings shared, per-version settings not"
406415

0 commit comments

Comments
 (0)