From 9eb832aad74547aaa0c4e6b4c1fab11f7d6a4bea Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Mon, 31 Aug 2026 05:11:56 -0700 Subject: [PATCH] test(cron): pin the lock-first contract on the red alarm, not the shared 'NOT fire' substring MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the #98790 heartbeat guard, a never-ticked gateway prints the YELLOW first-heartbeat notice (which also contains 'NOT fire'). The lock-first test's real contract (#87033) is that an active runtime lock suppresses the RED 'Gateway is not running' false alarm — assert that directly. --- tests/cron/test_87033_cronjob_gateway_liveness.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/cron/test_87033_cronjob_gateway_liveness.py b/tests/cron/test_87033_cronjob_gateway_liveness.py index df882d8be0..496083e8d0 100644 --- a/tests/cron/test_87033_cronjob_gateway_liveness.py +++ b/tests/cron/test_87033_cronjob_gateway_liveness.py @@ -312,7 +312,14 @@ class TestCronStatusLockFirst: def test_lock_active_suppresses_not_running_false_alarm(self, hermes_env): text = self._run_status(pids=[], lock_active=True, lock_pid=4242) - assert "NOT fire" not in text + # The lock-first contract (#87033): an active runtime lock means the + # gateway process is alive, so the RED "Gateway is not running" alarm + # must never fire. Since #98790 a never-written heartbeat is no longer + # silently green — the YELLOW first-heartbeat notice (which also says + # "NOT fire") is expected here, so assert on the red alarm itself + # rather than the "NOT fire" substring both messages share. + assert "Gateway is not running" not in text + assert "has not reported a heartbeat" in text assert "Gateway is running" in text or "running" in text def test_no_lock_no_pids_still_warns(self, hermes_env):