Skip to content

The agent that grows with you

test(e2e): dashboard suite passes the windows-footgun and encoding checks

teknium13094b5d0aa61
diff --git a/tests/e2e/core/dashboard/_helpers.py b/tests/e2e/core/dashboard/_helpers.py
index 2c8e62af717..04c860d8055 100644
--- a/tests/e2e/core/dashboard/_helpers.py
+++ b/tests/e2e/core/dashboard/_helpers.py
@@ -46,7 +46,7 @@ _READY_RE = re.compile(r"HERMES_DASHBOARD_READY port=(\d+)")
def real_user_home() -> Path:
import pwd
- return Path(pwd.getpwuid(os.getuid()).pw_dir).resolve()
+ return Path(pwd.getpwuid(os.getuid()).pw_dir).resolve() # windows-footgun: ok — Linux-only suite, never reached on Windows
def poll(pred: Callable[[], Any], timeout: float, what: str, interval: float = 0.05) -> Any:
@@ -222,9 +222,9 @@ def _assert_profiles_root_under(sb: Sandbox) -> None:
# The dashboard process -----------------------------------------------------------------------------
-def kill_group(proc: subprocess.Popen, sig: int = signal.SIGKILL) -> None:
+def kill_group(proc: subprocess.Popen, sig: int | None = None) -> None:
try:
- os.killpg(proc.pid, sig)
+ os.killpg(proc.pid, signal.SIGKILL if sig is None else sig) # windows-footgun: ok — Linux-only suite, never reached on Windows
except (ProcessLookupError, PermissionError):
pass
diff --git a/tests/e2e/core/dashboard/_reaper.py b/tests/e2e/core/dashboard/_reaper.py
index 631c1441197..25b42b8dc88 100644
--- a/tests/e2e/core/dashboard/_reaper.py
+++ b/tests/e2e/core/dashboard/_reaper.py
@@ -65,7 +65,7 @@ def release_orphans() -> None:
def stat(pid: int) -> list[str] | None:
"""``/proc/<pid>/stat`` fields after ``comm`` (state is index 0, ppid 1, sid 3, start 19)."""
try:
- return Path(f"/proc/{pid}/stat").read_text().rsplit(")", 1)[1].split()
+ return Path(f"/proc/{pid}/stat").read_text(encoding="utf-8", errors="replace").rsplit(")", 1)[1].split()
except (OSError, IndexError):
return None
@@ -130,7 +130,7 @@ def kill_identified(idents: dict[Identity, str]) -> list[str]:
if start_time(pid) != started:
continue
try:
- os.kill(pid, signal.SIGKILL)
+ os.kill(pid, signal.SIGKILL) # windows-footgun: ok — Linux-only suite, never reached on Windows
except ProcessLookupError:
continue
killed.append(f"{pid}: {cmd[:160]}")
diff --git a/tests/e2e/core/dashboard/test_api_session_chat_limits.py b/tests/e2e/core/dashboard/test_api_session_chat_limits.py
index ed87b72dae1..65616e9a543 100644
--- a/tests/e2e/core/dashboard/test_api_session_chat_limits.py
+++ b/tests/e2e/core/dashboard/test_api_session_chat_limits.py
@@ -14,6 +14,7 @@ Controls (enforced, separate test): a 60,000-char message through the same ``/ch
from __future__ import annotations
import secrets
+import sys
import time
from pathlib import Path
from typing import Any, Iterator
@@ -23,6 +24,7 @@ import pytest
from tests.e2e.core.dashboard._helpers import Sandbox, make_sandbox
from tests.e2e.core.dashboard._issue_helpers import GatewayApiServer, Issue120937, xfail_known
+pytestmark = pytest.mark.skipif(not sys.platform.startswith("linux"), reason="reaper reads /proc")
TURN_TIMEOUT = 90.0
KNOWN: dict[str, tuple[str, type]] = {
diff --git a/tests/e2e/core/dashboard/test_dashboard_mcp_install.py b/tests/e2e/core/dashboard/test_dashboard_mcp_install.py
index 7f2c0c9ee6a..3ce450b7725 100644
--- a/tests/e2e/core/dashboard/test_dashboard_mcp_install.py
+++ b/tests/e2e/core/dashboard/test_dashboard_mcp_install.py
@@ -30,6 +30,7 @@ import yaml
from tests.e2e.core.dashboard._helpers import Sandbox, make_sandbox
from tests.e2e.core.dashboard._issue_helpers import Issue120527, PtyDashboard, xfail_known
+pytestmark = pytest.mark.skipif(not sys.platform.startswith("linux"), reason="pty stdin + /proc reaper")
INSTALL_DEADLINE_S = 30.0 # a healthy install (write config + spawn/probe a local server) takes ~2 s
FOLLOWUP_DEADLINE_S = 5.0
FIXTURE = Path(__file__).with_name("fixture_catalog_mcp.py")
diff --git a/tests/e2e/core/dashboard/test_dashboard_profiles.py b/tests/e2e/core/dashboard/test_dashboard_profiles.py
index 4316cb35b8b..eaa8b3ae7a2 100644
--- a/tests/e2e/core/dashboard/test_dashboard_profiles.py
+++ b/tests/e2e/core/dashboard/test_dashboard_profiles.py
@@ -99,7 +99,7 @@ def test_profile_walk_reads_and_writes_only_the_selected_profile(fleet) -> None:
problems.append(f"step {step} ({name}): writes changed {sorted(changed)}")
if p.config().get("dash_canary", {}).get("step") != f"{name}-{step}":
problems.append(f"step {step} ({name}): config write did not land in {name}/config.yaml")
- if f"DASH_EXTRA=extra-{name}-{p.tag}-{step}" not in (p.home / ".env").read_text():
+ if f"DASH_EXTRA=extra-{name}-{p.tag}-{step}" not in (p.home / ".env").read_text(encoding="utf-8"):
problems.append(f"step {step} ({name}): env write did not land in {name}/.env")
assert not problems, "profile crossing during the A->B->A walk:\n " + "\n ".join(problems)