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(web): give the thread-race tests a generous sidecar wait bound (#7796)

LearningCircuitc4437d4fef7d
diff --git a/tests/web/routers/test_thread_safety.py b/tests/web/routers/test_thread_safety.py
index 98f25ee694..12a2bb93dd 100644
--- a/tests/web/routers/test_thread_safety.py
+++ b/tests/web/routers/test_thread_safety.py
@@ -79,6 +79,19 @@ def _hammer(client, path, n_requests=20, concurrency=5):
class TestSettingsManagerNoThreadRace:
"""Concurrent hits on SettingsManager-backed endpoints must all return 200."""
+ @pytest.fixture(autouse=True)
+ def _generous_sidecar_wait(self, monkeypatch):
+ # Every request claims the user's rekey sidecar several times, and
+ # the claims queue on one per-user lock. Past
+ # _SIDECAR_WAIT_TIMEOUT_SECONDS (5 s) a claim answers a retryable
+ # 503 by design. On a loaded CI runner (xdist plus coverage) five
+ # concurrent requests can queue past that, so these tests failed
+ # with 503s that say nothing about the thread race they check.
+ # The bound itself is covered in tests/database/test_sidecar_fault_probe.py.
+ from local_deep_research.database import encrypted_db
+
+ monkeypatch.setattr(encrypted_db, "_SIDECAR_WAIT_TIMEOUT_SECONDS", 60.0)
+
def test_concurrent_settings_api(self, auth_client):
statuses = _hammer(auth_client, "/settings/api")
assert all(s == 200 for s in statuses), (