fix: add port cleanup and retry for mock server startup
Some checks failed
ci/woodpecker/pr/smoke-init Pipeline is pending
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline failed

This commit is contained in:
Agent 2026-04-02 07:55:23 +00:00
parent 19b99346ab
commit 7226821b57
2 changed files with 6 additions and 2 deletions

View file

@ -31,7 +31,11 @@ steps:
- name: smoke-init
image: python:3-alpine
commands:
- apk add --no-cache bash curl jq git coreutils
- apk add --no-cache bash curl jq git coreutils procps
# Kill any existing mock server on port 3000
- fuser -k 3000/tcp 2>/dev/null || true
- sleep 1 # wait for port to be released
- python3 tests/mock-forgejo.py &
- sleep 1 # wait for mock to start
# Wait for mock to be ready
- for i in $(seq 1 30); do curl -sf http://localhost:3000/api/v1/version >/dev/null 2>&1 && break || sleep 1; done
- bash tests/smoke-init.sh