fix(e2e/ui): fail the run when the Presidio fixture never comes up

Both readiness loops broke out on success and fell through on timeout, so a
mock Presidio server that failed to bind left the run going with nothing
serving /analyze. The guardrail then errored at request time and the failure
surfaced as an unrelated Playwright assertion in presidioUserStory.spec.ts
rather than as the missing fixture it actually was.

Fail the local runner with the port in the message, and add the matching wait
step to both CircleCI UI jobs, which had no readiness check at all.
This commit is contained in:
Yuneng Jiang 2026-09-06 03:13:09 -07:00
parent 274a489c46
commit b0e53bfbe4
No known key found for this signature in database
2 changed files with 24 additions and 1 deletions

View file

@ -2652,6 +2652,15 @@ jobs:
name: Start mock Presidio server name: Start mock Presidio server
command: uv run --no-sync python tests/e2e/ui/fixtures/mock_presidio_server/server.py command: uv run --no-sync python tests/e2e/ui/fixtures/mock_presidio_server/server.py
background: true background: true
- run:
name: Wait for mock Presidio server
command: |
for i in $(seq 1 30); do
if curl -sf http://127.0.0.1:8091/health >/dev/null 2>&1; then exit 0; fi
sleep 1
done
echo "Mock Presidio server never answered /health on port 8091" >&2
exit 1
- run: - run:
name: Start LiteLLM proxy name: Start LiteLLM proxy
environment: environment:
@ -2786,6 +2795,15 @@ jobs:
name: Start mock Presidio server name: Start mock Presidio server
command: uv run --no-sync python tests/e2e/ui/fixtures/mock_presidio_server/server.py command: uv run --no-sync python tests/e2e/ui/fixtures/mock_presidio_server/server.py
background: true background: true
- run:
name: Wait for mock Presidio server
command: |
for i in $(seq 1 30); do
if curl -sf http://127.0.0.1:8091/health >/dev/null 2>&1; then exit 0; fi
sleep 1
done
echo "Mock Presidio server never answered /health on port 8091" >&2
exit 1
- run: - run:
name: Start LiteLLM proxy under a server root path name: Start LiteLLM proxy under a server root path
environment: environment:

View file

@ -212,10 +212,15 @@ echo "=== Starting mock Presidio server ==="
uv run --no-sync python "$SCRIPT_DIR/fixtures/mock_presidio_server/server.py" & uv run --no-sync python "$SCRIPT_DIR/fixtures/mock_presidio_server/server.py" &
MOCK_PRESIDIO_PID=$! MOCK_PRESIDIO_PID=$!
PRESIDIO_READY=0
for i in $(seq 1 15); do for i in $(seq 1 15); do
if curl -sf http://127.0.0.1:${MOCK_PRESIDIO_PORT}/health >/dev/null 2>&1; then break; fi if curl -sf http://127.0.0.1:${MOCK_PRESIDIO_PORT}/health >/dev/null 2>&1; then PRESIDIO_READY=1; break; fi
sleep 1 sleep 1
done done
if [ "$PRESIDIO_READY" -ne 1 ]; then
echo "Mock Presidio server never answered /health on port ${MOCK_PRESIDIO_PORT}" >&2
exit 1
fi
# --- LiteLLM proxy --- # --- LiteLLM proxy ---
echo "=== Starting LiteLLM proxy ===" echo "=== Starting LiteLLM proxy ==="