test: wait for Docker service readiness

This commit is contained in:
tifisht
2026-10-26 08:15:28 +08:00
parent fcbb409a12
commit 0e3af032e7
+4 -3
View File
@@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v6
- name: Build image and check dependencies - name: Build image and check dependencies
run: | run: |
@@ -46,8 +46,9 @@ jobs:
--publish 127.0.0.1:5000:5000 \ --publish 127.0.0.1:5000:5000 \
--mount "type=bind,src=$RUNNER_TEMP/netease-cookie.txt,dst=/app/cookie.txt,readonly" \ --mount "type=bind,src=$RUNNER_TEMP/netease-cookie.txt,dst=/app/cookie.txt,readonly" \
netease-url:smoke netease-url:smoke
curl --fail --silent --show-error --retry 30 --retry-connrefused \ curl --fail --silent --show-error --retry 30 --retry-all-errors \
--retry-delay 1 --max-time 5 http://127.0.0.1:5000/health > health.json --retry-delay 1 --retry-max-time 60 --max-time 5 \
--output health.json http://127.0.0.1:5000/health
python3 - <<'PY' python3 - <<'PY'
import json import json
with open('health.json') as response: with open('health.json') as response: