Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

test: stop two unit tests from depending on the CI runner (#404)

Ruben Lütkec8c25003f242
diff --git a/tests/unit/harness/test_cu_ensure_on_primary.py b/tests/unit/harness/test_cu_ensure_on_primary.py
index d632e59f96..fcc376bd04 100644
--- a/tests/unit/harness/test_cu_ensure_on_primary.py
+++ b/tests/unit/harness/test_cu_ensure_on_primary.py
@@ -104,7 +104,14 @@ def test_honest_note_when_move_refused_and_stuck_on_secondary(monkeypatch):
def test_foreground_window_non_windows_is_title_only(monkeypatch):
+ # An X11 desktop without xdotool degrades to a title-only window. The
+ # display, the session type and xdotool are pinned here instead of read
+ # from the host: on a Linux CI runner without a display the real probes
+ # took the "no window identity" branch and the result was None.
monkeypatch.setattr(ws, "detect_platform", lambda: "linux")
+ monkeypatch.setattr(ws, "is_wayland", lambda: False)
+ monkeypatch.setattr(ws, "display_present", lambda: True)
+ monkeypatch.setattr(ws.shutil, "which", lambda _name, *_args, **_kwargs: None)
monkeypatch.setattr(ws, "get_foreground_title", lambda: "Some App")
win = ws.foreground_window()
assert win is not None
diff --git a/tests/unit/workspace/test_launch_picks.py b/tests/unit/workspace/test_launch_picks.py
index ab85f92220..3079489b1b 100644
--- a/tests/unit/workspace/test_launch_picks.py
+++ b/tests/unit/workspace/test_launch_picks.py
@@ -18,6 +18,17 @@ from jarvis.workspace.agents import coding_agent_names, get_agent
DECLARING = [name for name in coding_agent_names() if launch_picks.picks_for(name) is not None]
[email protected](autouse=True)
+def _no_in_flight_model_reads(monkeypatch: pytest.MonkeyPatch) -> None:
+ """Every test starts with no CLI model-list read in flight.
+
+ A slow read one test leaves running can outlive that test's event loop
+ on a slow runner. Its task then never completes and stays registered, so
+ the next test would join it instead of starting its own read.
+ """
+ monkeypatch.setattr(launch_picks, "_IN_FLIGHT", {})
+
+
def test_some_entries_declare_picks() -> None:
"""A guard on the guard: an empty table would make every test below pass."""
assert "claude" in DECLARING