Skip to content

The agent that grows with you

test(windows-e2e): stop the gateway a prompt auto-started for each home

teknium1534255de9876
diff --git a/tests/e2e/core/windows/_helpers.py b/tests/e2e/core/windows/_helpers.py
index b2d6b2e5396..bef22723091 100644
--- a/tests/e2e/core/windows/_helpers.py
+++ b/tests/e2e/core/windows/_helpers.py
@@ -91,7 +91,13 @@ class WinHome:
return self.hermes_home / "state.db"
+#: Every home made this test, with its creation time: the lane's conftest stops the gateway a
+#: prompt auto-started for it (Desktop and CLI attach to one daemon that outlives the turn).
+MADE_HOMES: list[tuple[WinHome, float]] = []
+
+
def make_home(tmp_path: Path, base_url: str, *, extra_config: str = "") -> WinHome:
+ since = time.time()
root = tmp_path
profile = root / "Users" / "e2e"
hermes_home = profile / ".hermes"
@@ -105,6 +111,7 @@ def make_home(tmp_path: Path, base_url: str, *, extra_config: str = "") -> WinHo
cfg.setdefault("display", {})["compact"] = True
home.update_config(_hermetic)
+ MADE_HOMES.append((home, since))
return home
diff --git a/tests/e2e/core/windows/conftest.py b/tests/e2e/core/windows/conftest.py
new file mode 100644
index 00000000000..e1e11a8f925
--- /dev/null
+++ b/tests/e2e/core/windows/conftest.py
@@ -0,0 +1,22 @@
+"""Windows lane teardown: a prompt auto-starts the profile's gateway, which outlives the turn."""
+
+from __future__ import annotations
+
+import contextlib
+
+import pytest
+
+from tests.e2e.core.windows import _helpers as H
+
+
[email protected](autouse=True)
+def _stop_auto_started_gateways():
+ first = len(H.MADE_HOMES)
+ yield
+ made, H.MADE_HOMES[first:] = H.MADE_HOMES[first:], []
+ for home, since in made:
+ if not H.owned_processes(home, since=since):
+ continue
+ with contextlib.suppress(Exception):
+ H.hermes(home, "gateway", "stop", timeout=60)
+ H.kill_owned(home, since=since)