Skip to content

The agent that grows with you

test(update): fleet-matrix live-pid tests verify pytest as the home's gateway

teknium1f39b034db916
diff --git a/tests/hermes_cli/test_fleet_matrix_down_state.py b/tests/hermes_cli/test_fleet_matrix_down_state.py
index 0519e30c259..d8745934009 100644
--- a/tests/hermes_cli/test_fleet_matrix_down_state.py
+++ b/tests/hermes_cli/test_fleet_matrix_down_state.py
@@ -31,6 +31,13 @@ def _setup(monkeypatch, tmp_path, record: dict):
return home
+def _verify_self_as_gateway(monkeypatch):
+ """Without a socket answer the state file is only a claim; the fallback classifies a LIVE
+ pid from it only when the home's identity resolver verifies that pid as the gateway
+ (#110420). The live-pid tests write the record about pytest itself, so verify it."""
+ monkeypatch.setattr("gateway.status.live_gateway_pid_for_home", lambda h: os.getpid())
+
+
_DEAD_PID = 999999899 # never a live pid
@@ -100,6 +107,7 @@ def test_matching_start_time_is_still_live(monkeypatch, tmp_path):
from gateway.status import _get_process_start_time
pid = os.getpid()
+ _verify_self_as_gateway(monkeypatch)
_setup(
monkeypatch,
tmp_path,
@@ -118,6 +126,7 @@ def test_matching_start_time_is_still_live(monkeypatch, tmp_path):
def test_live_gateway_rows_unchanged(monkeypatch, tmp_path):
"""The live-pid path is untouched by the down-state addition."""
+ _verify_self_as_gateway(monkeypatch)
_setup(
monkeypatch,
tmp_path,