The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(gateway): pin the other-users filter in fake-/proc scan tests
Tekniumdd35ff4fc49f
diff --git a/tests/gateway/test_multiplex_secondary_port_binding_env.py b/tests/gateway/test_multiplex_secondary_port_binding_env.pyindex 0700c079061..758aec3d9b0 100644--- a/tests/gateway/test_multiplex_secondary_port_binding_env.py+++ b/tests/gateway/test_multiplex_secondary_port_binding_env.py@@ -94,9 +94,12 @@ def test_scan_gateway_pids_claims_own_home_spellings_not_the_sibling(fallback must not sweep a longer sibling home's live gateway, while the supervisortrailing-separator spelling (``HERMES_HOME=/root/.hermes/``) is still its own home."""import hermes_cli.gateway as gw+ import hermes_cli.gateway_migrate_guards as guardsmonkeypatch.setenv("HERMES_HOME", str(tmp_path))rendered = cmdline.format(home=tmp_path)monkeypatch.setattr(gw, "_iter_proc_cmdlines", lambda exclude: iter([(424242, rendered)]))+ # The fake pid is ours; the other-users filter would otherwise stat whatever process really holds it.+ monkeypatch.setattr(guards, "pid_is_other_users", lambda pid: False)monkeypatch.setattr(gw, "_get_ancestor_pids", set)monkeypatch.setattr(gw, "is_windows", lambda: False)monkeypatch.setattr(gw.os.path, "isdir", lambda p: p == "/proc")diff --git a/tests/hermes_cli/test_gateway_proc_fallback.py b/tests/hermes_cli/test_gateway_proc_fallback.pyindex cdaf636dc35..e02efbb3330 100644--- a/tests/hermes_cli/test_gateway_proc_fallback.py+++ b/tests/hermes_cli/test_gateway_proc_fallback.py@@ -76,6 +76,9 @@ class TestProcFallback:patch("os.path.isdir", side_effect=_isdir),patch("os.listdir", side_effect=_listdir),patch("builtins.open", side_effect=_open),+ # The fake /proc entries are ours: the other-users filter stats the REAL /proc/<pid>,+ # so a root-owned runner process that happens to hold PID 12345 dropped the fake gateway.+ patch("hermes_cli.gateway_migrate_guards.pid_is_other_users", return_value=False),patch("hermes_cli.gateway._get_ancestor_pids", return_value=set()),patch("subprocess.run") as mock_ps,):