Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

test(db): isolate cold-open initialization count (#5375)

Ziyang Guoc0b28919fe38
diff --git a/tests/database/test_concurrent_user_db_open.py b/tests/database/test_concurrent_user_db_open.py
index 6b353e9bbb..1a05b8279f 100644
--- a/tests/database/test_concurrent_user_db_open.py
+++ b/tests/database/test_concurrent_user_db_open.py
@@ -44,6 +44,10 @@ def test_concurrent_cold_open_runs_init_once(db_manager, monkeypatch):
# Evict (and dispose) the cached engine so the next opens are cold-opens
# that hit the build + migrate path concurrently. The DB file remains.
db_manager.close_user_database(username)
+ # Phase-2 rekey is a separate post-open workflow that can re-enter through
+ # the module-global manager. Isolate it so this test counts only the
+ # fixture manager's cold-open initialization under the per-user lock.
+ monkeypatch.setattr(db_manager, "_run_phase2_rekey", lambda *_args: None)
n_threads = 8
calls = []