From b0e53bfbe4e8bbeb1e3941d23728e1b5f8beaeaa Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Sun, 6 Sep 2026 03:13:09 -0700 Subject: [PATCH] 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. --- .circleci/config.yml | 18 ++++++++++++++++++ tests/e2e/ui/run_e2e.sh | 7 ++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 276555c0cf7..aa851f829e4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2652,6 +2652,15 @@ jobs: name: Start mock Presidio server command: uv run --no-sync python tests/e2e/ui/fixtures/mock_presidio_server/server.py 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: name: Start LiteLLM proxy environment: @@ -2786,6 +2795,15 @@ jobs: name: Start mock Presidio server command: uv run --no-sync python tests/e2e/ui/fixtures/mock_presidio_server/server.py 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: name: Start LiteLLM proxy under a server root path environment: diff --git a/tests/e2e/ui/run_e2e.sh b/tests/e2e/ui/run_e2e.sh index ad0454b6347..beb1bc8bf3b 100755 --- a/tests/e2e/ui/run_e2e.sh +++ b/tests/e2e/ui/run_e2e.sh @@ -212,10 +212,15 @@ echo "=== Starting mock Presidio server ===" uv run --no-sync python "$SCRIPT_DIR/fixtures/mock_presidio_server/server.py" & MOCK_PRESIDIO_PID=$! +PRESIDIO_READY=0 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 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 --- echo "=== Starting LiteLLM proxy ==="