From a2f95e4c0e0df2ffe8a55bd4033f0885d427fc86 Mon Sep 17 00:00:00 2001 From: kshitij <82637225+kshitijk4poor@users.noreply.github.com> Date: Sun, 2 Aug 2026 19:47:58 +0530 Subject: [PATCH] test(memory): hoisted-retriever fixture uses a real tmp db, not :memory: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review follow-up on the #76142 salvage: MemoryStore path-resolves and shares one process-wide connection per file, so MemoryStore(":memory:") creates a literal ./:memory: FILE whose state leaks across test runs — the second run of the file failed all three spy tests because the NULL-vector test had permanently wiped hrr_vector in the leaked db. tmp_path isolates each run; verified two consecutive runs green + full tests/plugins/memory/ green. --- tests/plugins/memory/test_holographic_retrieval.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/plugins/memory/test_holographic_retrieval.py b/tests/plugins/memory/test_holographic_retrieval.py index 3b5f899788..ce8e3f7bae 100644 --- a/tests/plugins/memory/test_holographic_retrieval.py +++ b/tests/plugins/memory/test_holographic_retrieval.py @@ -108,10 +108,15 @@ from plugins.memory.holographic import holographic as hrr @pytest.fixture -def hoisted_retriever(): +def hoisted_retriever(tmp_path): """30 facts with HRR vectors, default dim (smaller dims trip an - inhomogeneous-shape edge in the fact encoder).""" - store = MemoryStore(":memory:") + inhomogeneous-shape edge in the fact encoder). + + NOTE: a real tmp_path db, NOT ":memory:" — MemoryStore resolves the + path and shares one process-wide connection per file, so ":memory:" + becomes a literal ./:memory: file that leaks state across runs (and + the NULL-vector test below would permanently corrupt it).""" + store = MemoryStore(str(tmp_path / "hoist_store.db")) for i in range(30): store.add_fact( content=f"deploy target {i} setting alpha beta gamma option {i % 7}",