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(ci): isolate lifespan CSS probe (#7030)

LearningCircuit532d345dabc0
diff --git a/tests/web/test_lifespan_startup_shutdown.py b/tests/web/test_lifespan_startup_shutdown.py
index 2f603995e7..9ec87a4211 100644
--- a/tests/web/test_lifespan_startup_shutdown.py
+++ b/tests/web/test_lifespan_startup_shutdown.py
@@ -136,6 +136,16 @@ from local_deep_research.web.queue.processor_v2 import queue_processor
from local_deep_research.web.services import socketio_asgi
from local_deep_research.web.themes import theme_registry
+# Pytest workers share the checkout, so another boot can rewrite the real
+# themes.css between this probe's before/after snapshots. Give each child its
+# own stylesheet path while still running the real lifespan code.
+probe_static_dir = OUT.parent / "static"
+(probe_static_dir / "css").mkdir(parents=True)
+fastapi_app.STATIC_DIR = str(probe_static_dir)
+css_path = probe_static_dir / "css" / "themes.css"
+if MODE == "themes-broken":
+ css_path.write_text("/* unchanged on generation failure */", encoding="utf-8")
+
# --- instrumentation -------------------------------------------------------
# Every wrapper calls through to the real implementation, so the observed
# behaviour (threads actually started, actually joined) is the real one.
@@ -225,13 +235,11 @@ db_manager.close_all_databases = _close_all
if MODE == "themes-broken":
def _broken_css():
+ record("get_combined_css_failed")
raise RuntimeError("simulated themes.css generation failure")
theme_registry.get_combined_css = _broken_css
-css_path = Path(fastapi_app.STATIC_DIR) / "css" / "themes.css"
-
-
def _css_stat():
if not css_path.exists():
return None
@@ -726,6 +734,10 @@ def test_a_guarded_startup_step_failure_does_not_stop_the_server(
)
events = _events(themes_broken_boot)
+ assert events.count("get_combined_css_failed") == 1, (
+ "the broken theme generator was never reached exactly once; "
+ f"trace was {events}"
+ )
assert "serving" in events and "close_all_databases" in events, (
"after a guarded-step failure the app must still complete a full "
f"startup AND shutdown cycle; trace was {events}"