fix(ci): add explicit readiness wait for E2E services
CI / Lint & Typecheck (push) Successful in 25s
CI / Test (push) Successful in 27s
CI / Build (push) Successful in 24s
CI / E2E Tests (push) Failing after 46s
CI / Build & Push Docker Images (push) Has been skipped
CI / Update Infra Image Tags (push) Has been skipped
CI / Web E2E (Dev) (push) Has been cancelled
CI / Deploy PR to groombook-dev (push) Has been cancelled

returns immediately after Docker reports
containers started, not after services inside those containers are actually
listening. This causes Playwright to hit nginx before it's ready.

Now:
- Start containers with  (no --wait)
- Poll http://localhost:8080 AND http://localhost:3000/health every 10s,
  up to 30 attempts (5 minutes total)
- Only proceed to E2E tests once both are reachable

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-05-21 21:13:20 +00:00
parent c12935de9c
commit 990bc4400c
+15 -1
View File
@@ -76,9 +76,23 @@ jobs:
run: pnpm --filter @groombook/e2e exec playwright install --with-deps chromium
- name: Start Docker Compose stack
run: docker compose up -d --wait
run: docker compose up -d
timeout-minutes: 5
- name: Wait for services to be ready
run: |
echo "Waiting for services to become ready..."
for i in $(seq 1 30); do
if curl -sf http://localhost:8080 > /dev/null 2>&1 && curl -sf http://localhost:3000/health > /dev/null 2>&1; then
echo "Services ready after ${i} attempts"
exit 0
fi
echo "Attempt $i/30: services not ready yet, waiting 10s..."
sleep 10
done
echo "Warning: services may not be fully ready after 30 attempts (5m)"
timeout-minutes: 6
- name: Run E2E tests
run: pnpm --filter @groombook/e2e test
env: