From 2b3fedacbb2e9a04f272ae632f91340d099d4a3b Mon Sep 17 00:00:00 2001 From: ethernet Date: Thu, 30 Jul 2026 12:35:24 -0400 Subject: [PATCH] fix(tests): two more container-env parity pins in gateway service tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - test_supports_systemd_services_returns_true_when_systemctl_present: pin is_container=False (host contract; CI runner pods are containers) - test_systemd_restart_gracefully_restarts_running_service_and_waits: stub _preflight_user_systemd — no user D-Bus in runner pods; the test asserts restart choreography, not D-Bus reachability --- tests/hermes_cli/test_gateway_service.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/hermes_cli/test_gateway_service.py b/tests/hermes_cli/test_gateway_service.py index 6d2ad47bc11..c0e8300f39b 100644 --- a/tests/hermes_cli/test_gateway_service.py +++ b/tests/hermes_cli/test_gateway_service.py @@ -460,6 +460,8 @@ class TestGatewayServiceDetection: monkeypatch.setattr(gateway_cli, "is_linux", lambda: True) monkeypatch.setattr(gateway_cli, "is_termux", lambda: False) monkeypatch.setattr(gateway_cli, "is_wsl", lambda: False) + # CI runner pods are containers; pin the host case this test covers. + monkeypatch.setattr(gateway_cli, "is_container", lambda: False) monkeypatch.setattr(gateway_cli.shutil, "which", lambda name: "/usr/bin/systemctl") assert gateway_cli.supports_systemd_services() is True @@ -495,6 +497,10 @@ class TestGatewaySystemServiceRouting: monkeypatch.setattr(gateway_cli, "_select_systemd_scope", lambda system=False: False) monkeypatch.setattr(gateway_cli, "_require_service_installed", lambda action, system=False: None) + # Preflight probes the real user D-Bus; on CI runner pods there is + # none and it raises UserSystemdUnavailableError. Stub it — this + # test asserts the restart choreography, not D-Bus reachability. + monkeypatch.setattr(gateway_cli, "_preflight_user_systemd", lambda: None) monkeypatch.setattr(gateway_cli, "refresh_systemd_unit_if_needed", lambda system=False: calls.append(("refresh", system))) monkeypatch.setattr(gateway_cli, "_get_restart_drain_timeout", lambda: 12.0) monkeypatch.setattr(