From f31d1101e65fd97dad34b8a6e5cea281a8ad1faf Mon Sep 17 00:00:00 2001 From: Jaixii Date: Tue, 4 Aug 2026 11:45:22 -0400 Subject: [PATCH] test: make consolidation cursor fixture keyset-stable --- tests/test_consolidate.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_consolidate.py b/tests/test_consolidate.py index cb6dc5d4..09281ba2 100644 --- a/tests/test_consolidate.py +++ b/tests/test_consolidate.py @@ -1013,8 +1013,15 @@ def test_distill_cursor_carries_interleaved_partial_cluster(monkeypatch): ) for index in range(9) ] + # The maintenance cursor is a keyset cursor over sorted ULIDs. Several writes can + # share a millisecond, so insertion order is not a stable proxy for page order. + ordered_ids = [ + memory.id for memory in eng.store.list_memories_page( + SearchFilter(workspace_id=wid, repo_id=rid), limit=len(source_ids), + ) + ] recurring = { - source_ids[index]: f"Recurring deploy failure during run {index}." + ordered_ids[index]: f"Recurring deploy failure during run {index}." for index in (0, 3, 6) } for memory_id, content in recurring.items():