Skip to content

The agent that grows with you

test: update restart leaves other homes' units and gateways alone (#93349)

teknium1f43eef9e27ff
diff --git a/tests/hermes_cli/test_pending_supervisor_recovery.py b/tests/hermes_cli/test_pending_supervisor_recovery.py
index 6752040de43..bdc0c2485d8 100644
--- a/tests/hermes_cli/test_pending_supervisor_recovery.py
+++ b/tests/hermes_cli/test_pending_supervisor_recovery.py
@@ -7,6 +7,13 @@ import pytest
from hermes_cli import gateway, main, update_cmd_fleet as fleet, update_receipt
[email protected](autouse=True)
+def _units_belong_to_this_update(monkeypatch):
+ """The fake ``hermes-gateway-one/two`` units carry no home; ownership (#93349,
+ ``test_update_fleet_home_scope.py``) is pinned so this file keeps testing the catch-up contract."""
+ monkeypatch.setattr(fleet, "_systemd_unit_owned_by_update", lambda scope_cmd, svc_name: True)
+
+
@pytest.mark.linux_only
@pytest.mark.parametrize("failure", ["listing", "timeout", "missing", "restart", "inactive", "running", "missing-owned", None])
def test_pending_marker_requires_complete_systemd_recovery(monkeypatch, tmp_path, failure):
diff --git a/tests/hermes_cli/test_update_host_obligation.py b/tests/hermes_cli/test_update_host_obligation.py
index 1c554c83f49..f3adad4056f 100644
--- a/tests/hermes_cli/test_update_host_obligation.py
+++ b/tests/hermes_cli/test_update_host_obligation.py
@@ -28,6 +28,14 @@ from hermes_cli import update_cmd
SHA = "a" * 40
[email protected](autouse=True)
+def _units_belong_to_this_update(monkeypatch):
+ """The fake units here run on invented PIDs (4242, per-unit tables) with no readable home;
+ ownership (#93349, ``test_update_fleet_home_scope.py``) is pinned so these tests keep proving
+ the once-per-host-process collapse, not home scoping."""
+ monkeypatch.setattr(fleet, "_systemd_unit_owned_by_update", lambda scope_cmd, svc_name: True)
+
+
@pytest.fixture
def two_profiles(tmp_path, monkeypatch):
"""Two profile HERMES_HOMEs behind ONE host state dir — the real multiplex topology."""
diff --git a/tests/hermes_cli/test_update_unit_client_budget.py b/tests/hermes_cli/test_update_unit_client_budget.py
index 4ba823a52c5..9963575b253 100644
--- a/tests/hermes_cli/test_update_unit_client_budget.py
+++ b/tests/hermes_cli/test_update_unit_client_budget.py
@@ -6,6 +6,13 @@ import pytest
from hermes_cli import update_cmd_fleet as fleet
[email protected](autouse=True)
+def _units_belong_to_this_update(monkeypatch):
+ """Fake units on an invented MainPID (42) have no readable home; ownership (#93349,
+ ``test_update_fleet_home_scope.py``) is pinned so these tests keep proving budgets and health."""
+ monkeypatch.setattr(fleet, "_systemd_unit_owned_by_update", lambda scope_cmd, svc_name: True)
+
+
@pytest.mark.parametrize("graceful,retry", [(False, False), (False, True), (True, False), ("catchup", False)])
def test_unit_transaction_budget_preserves_scope_and_health(monkeypatch, graceful, retry):
catchup = graceful == "catchup"