Skip to content

Commit 4832f2a

Browse files
committed
test: make ordinary graph query assertion order independent
1 parent 0998043 commit 4832f2a

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tests/test_memory_graph_integration.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,14 @@ def build_pipeline(workspace: Path, enable_graph: bool) -> MemoryPipeline:
219219
off_results = graph_off.read("service", max_results=4)
220220
on_results = graph_on.read("service", max_results=4)
221221

222-
assert [result["content"] for result in on_results] == [
222+
# The lexical score includes time-sensitive recency/usage terms. These
223+
# pipelines are built independently, so tied candidates may legitimately
224+
# arrive in a different order on another platform. The graph opt-in
225+
# contract for an ordinary query is that it preserves the same candidates,
226+
# not a platform-specific ordering of equal-scoring entries.
227+
assert sorted(result["content"] for result in on_results) == sorted(
223228
result["content"] for result in off_results
224-
]
229+
)
225230
assert all("graph" not in result for result in on_results)
226231

227232

0 commit comments

Comments
 (0)