The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(process): POSIX-only tests use the platforms marker; the Raft stop test checks timeout=0
kshitijk4pooraaf1ddded946
diff --git a/tests/hermes_cli/test_owned_agent_subprocs.py b/tests/hermes_cli/test_owned_agent_subprocs.pyindex 5817f1d33be..653d28b24ce 100644--- a/tests/hermes_cli/test_owned_agent_subprocs.py+++ b/tests/hermes_cli/test_owned_agent_subprocs.py@@ -12,7 +12,6 @@ import osimport signalimport subprocessimport sys-import timefrom pathlib import Pathimport psutil@@ -194,8 +193,6 @@ def _reap(proc: subprocess.Popen) -> None:@pytest.mark.asyncioasync def test_whatsapp_disconnect_releases_the_bridge_it_stopped(monkeypatch):- from plugins.platforms.whatsapp import adapter as wa-released = []monkeypatch.setattr(process_identity, "release_process_groups", lambda pgids: released.append(list(pgids)))bridge = _sleeper()@@ -269,8 +266,15 @@ def test_a_stopped_bridge_whose_child_survived_stays_covered(monkeypatch, tmp_pareleasing that group would let the helper outlive a later kill -9 of this process."""from plugins.platforms.raft import adapter as raft- released = []+ released, release_timeouts = [], []monkeypatch.setattr(process_identity, "release_process_groups", lambda pgids: released.append(list(pgids)))+ real_release = raft.release_process_group_once_empty++ def recording_release(pgid, **kwargs):+ release_timeouts.append(kwargs.get("timeout"))+ return real_release(pgid, **kwargs)++ monkeypatch.setattr(raft, "release_process_group_once_empty", recording_release)receipt = tmp_path / "helper.pid"bridge = subprocess.Popen( # detached-spawn: ok — test bridge stand-in; its group is killed in finally["sh", "-c", f"(trap '' TERM; echo $(exec sh -c 'echo $PPID') > {receipt}; exec sleep 60) & exec sleep 60"],@@ -279,11 +283,10 @@ def test_a_stopped_bridge_whose_child_survived_stays_covered(monkeypatch, tmp_paa._bridge_process = bridgetry:wait_until(receipt.exists, what="helper receipt")- started = time.monotonic()a._stop_bridge()- # disconnect() runs this on the event loop: the live helper must not make it sleep out the- # release wait (it took a full second with the default timeout).- assert time.monotonic() - started < 0.8, "_stop_bridge() blocked on the surviving helper"+ # disconnect() runs this on the event loop: the release must probe once (timeout=0), not+ # sleep out the default wait on the surviving helper.+ assert release_timeouts == [0], "_stop_bridge() would block the event loop on the surviving helper"assert bridge.poll() is not None, "_stop_bridge() left the bridge running"assert released == [], "a group with a live helper was released from the owner-death supervisor"finally:diff --git a/tests/hermes_cli/test_process_identity.py b/tests/hermes_cli/test_process_identity.pyindex 952d83c46a8..ac30d3728d3 100644--- a/tests/hermes_cli/test_process_identity.py+++ b/tests/hermes_cli/test_process_identity.py@@ -493,7 +493,7 @@ def test_concurrent_processes_never_drop_each_others_ledger_rows(tmp_path):w.wait(timeout=30)[email protected](os.name == "nt", reason="fcntl lock holder")[email protected]("posix") # an fcntl lock holderdef test_a_stalled_ledger_lock_holder_never_blocks_register_child(tmp_path, monkeypatch, caplog):"""A holder stopped mid-write (SIGSTOP, a debugger) kept the lock: every spawn_owned on themachine then waited forever. Past the timeout the row is written under the thread lock alone, anddiff --git a/tests/hermes_cli/test_shared_metrics_exit_flush.py b/tests/hermes_cli/test_shared_metrics_exit_flush.pyindex f74bf26576d..f8ebdafdccf 100644--- a/tests/hermes_cli/test_shared_metrics_exit_flush.py+++ b/tests/hermes_cli/test_shared_metrics_exit_flush.py@@ -153,7 +153,7 @@ def test_sigtermed_kanban_worker_writes_the_open_sessions_summary(metrics_home,assert "hermes.session.count" in _metric_names(home)[email protected](os.name != "posix", reason="the legacy parent watchdog is POSIX-only")[email protected]("posix") # the legacy parent watchdog is POSIX-onlydef test_orphaned_slash_worker_writes_the_open_sessions_summary(metrics_home, monkeypatch):from tui_gateway import slash_worker