From fc2f5c8669d874bb4faebad5b95297954a8a2616 Mon Sep 17 00:00:00 2001 From: Josh Creek <8179928+jcreek@users.noreply.github.com> Date: Sat, 5 Sep 2026 19:27:35 +0100 Subject: [PATCH] test(compose): report the actual status when the idempotency conflict check fails The ERR trap added in 432e5a11 located the CI failure at the `[[ "$conflict_status" == 409 ]]` assertion, but the request discarded its body and the assertion printed nothing, so three failing runs never revealed what the API actually returned. Print the status and body on mismatch. --- scripts/verify_allocated_compose.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/verify_allocated_compose.sh b/scripts/verify_allocated_compose.sh index d0948f4f..82ca1c5b 100755 --- a/scripts/verify_allocated_compose.sh +++ b/scripts/verify_allocated_compose.sh @@ -146,12 +146,23 @@ queue_revision="$(python3 -c 'import json,sys; print(json.load(sys.stdin)["revis # Reusing a queue idempotency key with different command material must not # silently turn into a second ticket or a successful replay. -conflict_status="$(curl -sS -o /dev/null -w '%{http_code}' -X POST "$api_url/v1/queue" \ +conflict_body="$(mktemp)" +conflict_status="$(curl -sS -o "$conflict_body" -w '%{http_code}' -X POST "$api_url/v1/queue" \ -H "Authorization: Bearer $access_token" \ -H 'Idempotency-Key: compose-queue-key-123456' \ -H 'Content-Type: application/json' \ -d '{"ticket_id":"compose-other-ticket","playlist":"casual","client_build":"build-1","protocol_version":1}')" -[[ "$conflict_status" == 409 ]] +if [[ "$conflict_status" != 409 ]]; then + # Report what actually came back. A bare [[ ]] here just aborts, which is + # how this assertion failed in CI three times without ever saying what the + # status was. + echo "idempotency conflict returned ${conflict_status}, want 409; body:" >&2 + cat "$conflict_body" >&2 || true + echo >&2 + rm -f "$conflict_body" + exit 1 +fi +rm -f "$conflict_body" heartbeat_json="$(curl -fsS -X POST "$api_url/v1/queue/compose-queue-ticket/heartbeat" \ -H "Authorization: Bearer $access_token" \