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.

fix: timing attack test flaky due to xdist cross-test mock pollution (#2798)

LearningCircuit95276f7def63
diff --git a/tests/database/test_encrypted_db_manager.py b/tests/database/test_encrypted_db_manager.py
index 44d68bf849..8d3eaadf58 100644
--- a/tests/database/test_encrypted_db_manager.py
+++ b/tests/database/test_encrypted_db_manager.py
@@ -1422,7 +1422,11 @@ class TestTimingAttackPrevention:
except Exception:
pass # May fail later; we verify key derivation happened
- mock_derive.assert_called_once()
+ # Verify key derivation was called with the expected arguments.
+ # Use assert_any_call instead of assert_called_once because
+ # concurrent xdist workers sharing the same process may trigger
+ # additional calls from other tests (e.g. auth route tests).
+ mock_derive.assert_any_call("password123", db_path=db_path)
@patch("local_deep_research.database.encrypted_db.get_data_directory")
def test_metrics_session_derives_key_before_file_check(