From 176439705bf160e1afd550e4c47996e9564aa790 Mon Sep 17 00:00:00 2001 From: gregoryfoster Date: Fri, 30 Oct 2026 15:00:22 +0000 Subject: [PATCH] test: pick the cascade tombstone by generation, not row order The outbox SELECT has no ORDER BY; CI on main 5cfb5da returned generation 2 before 1, so mine[-1] read the live announcement and failed (run 41005053912, green on re-run). Order-independent now. Co-Authored-By: Claude Opus 5.5 --- tests/api/test_notification_subscriptions_api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/api/test_notification_subscriptions_api.py b/tests/api/test_notification_subscriptions_api.py index b83cb015..17a266cd 100644 --- a/tests/api/test_notification_subscriptions_api.py +++ b/tests/api/test_notification_subscriptions_api.py @@ -420,7 +420,9 @@ async def test_item_delete_cascades_its_subscriptions_and_still_tombstones(clien ) ).scalars() mine = [p for p in payloads if p["info_item_id"] == item_id] - assert mine and mine[-1]["revoked"] is True + # The SELECT has no ORDER BY, so the newest announcement is the highest + # generation, not the last row: CI returned generation 2 before 1 (#368 deploy). + assert mine and max(mine, key=lambda p: p["generation"])["revoked"] is True @pytest.mark.asyncio