Files
hermes-agent/tests/hermes_cli/test_dump_gateway_status.py
teknium1 2dc8f7715a fix(dump): report a supervised gateway without a scannable PID as running (#125390)
hermes_cli/dump.py::_gateway_status indexed snapshot.gateway_pids[0] whenever snapshot.running
was true. Under s6 the service is up but the process scan is empty (python -c launcher argv,
no gateway.pid), so the IndexError was swallowed into "unknown". Same class as the
_cmd_status bug: a supervisor-reported service must not be equated with a PID hit.

Topology T10 (s6/Docker).
2026-09-28 13:30:57 -07:00

15 lines
733 B
Python

"""``hermes dump`` gateway line for a supervised gateway with no scannable PID (#125390)."""
from __future__ import annotations
from hermes_cli.dump import _gateway_status
from hermes_cli.gateway import GatewayRuntimeSnapshot
def test_s6_supervised_gateway_without_pid_is_running_not_unknown(monkeypatch):
"""s6 service up, empty process scan: ``running (...)`` — not an IndexError swallowed into ``unknown``."""
snapshot = GatewayRuntimeSnapshot(
manager="s6 (container supervisor)", service_installed=True, service_running=True, gateway_pids=())
monkeypatch.setattr("hermes_cli.gateway.get_gateway_runtime_snapshot", lambda: snapshot)
assert _gateway_status() == "running (s6 (container supervisor))"