fix(ci): wait for Mongo via docker exec mongosh, not nc
Some checks failed
Test / vitest (push) Successful in 11m17s
Test / playwright (push) Failing after 10m2s
Test / visual (push) Failing after 10m5s
Test / Notify on failure (push) Successful in 3s

The Forgejo runner image doesn't ship netcat — 30 retries of
'sh: 1: nc: not found' just burned the timeout. Use mongosh from
inside the container; no host-side tooling needed.
This commit is contained in:
Jennie Robinson Faber 2026-05-01 08:29:00 +01:00
parent 43eda6db04
commit 0985f6acb1

View file

@ -44,7 +44,7 @@ jobs:
docker run -d --name mongo-ci --network host mongo:7
docker ps
- name: Wait for MongoDB
run: timeout 30 sh -c 'until nc -z localhost 27017; do sleep 1; done'
run: timeout 30 sh -c 'until docker exec mongo-ci mongosh --quiet --eval "1" >/dev/null 2>&1; do sleep 1; done'
- name: MongoDB log on failure
if: failure()
run: docker logs mongo-ci || true
@ -107,7 +107,7 @@ jobs:
docker run -d --name mongo-ci --network host mongo:7
docker ps
- name: Wait for MongoDB
run: timeout 30 sh -c 'until nc -z localhost 27017; do sleep 1; done'
run: timeout 30 sh -c 'until docker exec mongo-ci mongosh --quiet --eval "1" >/dev/null 2>&1; do sleep 1; done'
- name: MongoDB log on failure
if: failure()
run: docker logs mongo-ci || true