From 08252b3cd760a426115723a5bc47c5d784a7dfff Mon Sep 17 00:00:00 2001 From: Hongming Wang Date: Wed, 29 Apr 2026 23:10:36 -0700 Subject: [PATCH] fix(e2e): use real UUIDs for poll-mode test workspace ids MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI run on PR #2355 surfaced `pq: invalid input syntax for type uuid: ws-poll-e2e-1777529293-3363` — workspaces.id is UUID-typed and the hand-rolled "ws-" shape fails the cast. Phase 1 returned generic 'registration failed' which cascaded into Phase 3 'lookup failed' (resolveAgentURL on a non-existent row) and Phase 4 'missing workspace auth token' (no token extracted because Phase 1 didn't run the bootstrap path). Generate v4 UUIDs via uuidgen (with a python3 fallback), one each for the poll workspace, the caller workspace, and the Phase 2 invalid-mode probe. Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/e2e/test_poll_mode_e2e.sh | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/tests/e2e/test_poll_mode_e2e.sh b/tests/e2e/test_poll_mode_e2e.sh index 844849c8..e4dd22bc 100755 --- a/tests/e2e/test_poll_mode_e2e.sh +++ b/tests/e2e/test_poll_mode_e2e.sh @@ -22,12 +22,23 @@ PASS=0 FAIL=0 TIMEOUT="${A2A_TIMEOUT:-30}" -# Per-run unique ids — same shape as test_2307_peer_visibility_staging.sh. -# Date+pid keeps reruns isolated; trap cleans up the row at the end so -# /workspaces lists don't accumulate test garbage on a long-lived dev DB. -RUN_TAG="poll-e2e-$(date +%s)-$$" -POLL_WS_ID="ws-${RUN_TAG}" -CALLER_WS_ID="ws-caller-${RUN_TAG}" +# Per-run unique ids — workspaces.id is a UUID column, so we generate +# real v4 UUIDs. A "ws-" string fails the pq UUID cast and surfaces +# as opaque "registration failed" (caught against this very test in CI +# before merge — the failure mode that motivates the helper). +gen_uuid() { + if command -v uuidgen >/dev/null 2>&1; then + uuidgen | tr '[:upper:]' '[:lower:]' + else + python3 -c 'import uuid; print(uuid.uuid4())' + fi +} +POLL_WS_ID="$(gen_uuid)" +CALLER_WS_ID="$(gen_uuid)" +# Phase 2 uses a separate UUID for its invalid-mode probe so a rerun +# can't poison POLL_WS_ID's row with a bad upsert (the 400 path doesn't +# touch DB, but defense in depth). +INVALID_PROBE_ID="$(gen_uuid)" cleanup() { local rc=$? @@ -117,7 +128,7 @@ echo "--- Phase 2: Invalid delivery_mode rejected ---" INVALID_RESP=$(curl -s -w '\n%{http_code}' -X POST "$BASE/registry/register" \ -H "Content-Type: application/json" \ -d "{ - \"id\": \"${POLL_WS_ID}-bad\", + \"id\": \"$INVALID_PROBE_ID\", \"delivery_mode\": \"webhook\", \"agent_card\": {\"name\": \"bad\"} }")