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" \