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: fix flaky rate-limit-triggered failures in rag upload coverage (#3943)

LearningCircuitd2a0889014ef
diff --git a/tests/research_library/routes/test_rag_routes_upload_coverage.py b/tests/research_library/routes/test_rag_routes_upload_coverage.py
index 85a488a6b1..583a973673 100644
--- a/tests/research_library/routes/test_rag_routes_upload_coverage.py
+++ b/tests/research_library/routes/test_rag_routes_upload_coverage.py
@@ -22,6 +22,9 @@ from flask import Flask, jsonify
from local_deep_research.web.auth.routes import auth_bp
from local_deep_research.research_library.routes.rag_routes import rag_bp
+from local_deep_research.security.rate_limiter import (
+ limiter as _real_limiter,
+)
# ---------------------------------------------------------------------------
# Constants
@@ -152,6 +155,13 @@ def _auth_client(
patch(f"{MODULE}.limiter", Mock(exempt=lambda f: f)),
patch(f"{MODULE}.upload_rate_limit_user", lambda f: f),
patch(f"{MODULE}.upload_rate_limit_ip", lambda f: f),
+ # The decorators above were applied at module-import time (closures
+ # over the real Limiter), so patching the module symbols can't undo
+ # them. Disable the real limiter for the duration of the test
+ # instead, so per-test-process rate-limit budget consumed by other
+ # tests in the same session can't bleed in here. The patch restores
+ # the previous value on exit.
+ patch.object(_real_limiter, "enabled", False),
]
if extra_patches:
patches.extend(extra_patches)