From 5651f250e5c87020754c7b2713e815ec88a39e61 Mon Sep 17 00:00:00 2001 From: zlareb1 Date: Wed, 2 Dec 2026 20:44:01 +0530 Subject: [PATCH] The concurrent resolver test seeds distinct values for Undo A delete refuses the same value under another key in the namespace. Give each pair its own values so the test can verify Undo after independent deletes. Signed-off-by: zlareb1 --- tests/integration/test_conflict_resolver_ch.py | 15 ++++++++++++--- .../test_conflict_resolver_invariants_ch.py | 11 ++++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/tests/integration/test_conflict_resolver_ch.py b/tests/integration/test_conflict_resolver_ch.py index 5d81235b56d..adc2b112615 100644 --- a/tests/integration/test_conflict_resolver_ch.py +++ b/tests/integration/test_conflict_resolver_ch.py @@ -584,7 +584,16 @@ async def clear(**kw: Any) -> ConflictResult: assert (await _marks(ch, org))["office_location"] == 2 -async def _pair(ch: Any, org: str, old: str, new: str, axis: int, *, gap: bool = True) -> None: +async def _pair( + ch: Any, + org: str, + old: str, + new: str, + axis: int, + *, + gap: bool = True, + values: tuple[str, str] = ("The office is in Paris", "The office moved to Rome"), +) -> None: """An older row and, a second later (or at once), a newer owed one close to it.""" from server.memory.app import after_write, conflicts from server.memory.domain.conflicts import ConflictResult @@ -594,10 +603,10 @@ async def clear(**kw: Any) -> ConflictResult: with pytest.MonkeyPatch.context() as m: m.setattr(conflicts, "check_on_commit", clear) - await _set(org, "s1", old, "The office is in Paris") + await _set(org, "s1", old, values[0]) if gap: await _later() - await _set(org, "s2", new, "The office moved to Rome") + await _set(org, "s2", new, values[1]) await after_write.drain() await _place(ch, org, "s1", old, _vec((axis, 1.0)), owed=False) await _place(ch, org, "s2", new, _vec((axis, 0.8), (axis + 1, 0.6)), owed=True) diff --git a/tests/integration/test_conflict_resolver_invariants_ch.py b/tests/integration/test_conflict_resolver_invariants_ch.py index c18437d22d8..fb1ebc9cccf 100644 --- a/tests/integration/test_conflict_resolver_invariants_ch.py +++ b/tests/integration/test_conflict_resolver_invariants_ch.py @@ -457,7 +457,16 @@ async def slow_embed(w: Any, embedder: Any = None) -> Any: monkeypatch.setattr(write, "_set_embed", slow_embed) for old, new, axis in _PAIRS: - await _pair(ch, org, old, new, axis, gap=old != "budget") + # A deletion refuses the same value under other keys in this namespace. + await _pair( + ch, + org, + old, + new, + axis, + gap=old != "budget", + values=(f"Earlier {old} fact", f"Current {new} fact"), + ) # Another user's row, and another tenant's, right next to the first pair. await _set(org, "s9", "office_u2", _SECRET, user="u2") await _place(ch, org, "s9", "office_u2", _vec((100, 1.0), (101, 0.01)), owed=False, user="u2")