The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(git): graced-kill test waits with wait_until, cleanup in finally
Teknium0c771d7a5ba7
diff --git a/tests/hermes_cli/test_git_probe_tree_kill.py b/tests/hermes_cli/test_git_probe_tree_kill.pyindex af309e5248b..b8215b124d2 100644--- a/tests/hermes_cli/test_git_probe_tree_kill.py+++ b/tests/hermes_cli/test_git_probe_tree_kill.py@@ -21,6 +21,7 @@ import pytestfrom hermes_cli import _subprocess_compatfrom hermes_cli._subprocess_compat import bounded_git_probe, kill_process_tree+from tests.waiting import wait_untilpytestmark = pytest.mark.platforms("posix") # POSIX process-group semantics@@ -128,14 +129,13 @@ def test_grace_kill_takes_a_term_ignoring_member_once_the_leader_exits(tmp_path)kill_process_tree(proc, grace=5.0)- assert proc.returncode is not None- deadline = time.monotonic() + 3.0- while time.monotonic() < deadline and _pid_alive(member):- time.sleep(0.05)- alive = _pid_alive(member)- if alive: # reparented out of our subtree, so the live-system guard refuses os.kill here- subprocess.run(["kill", "-9", str(member)], check=False)- assert not alive, f"SIGTERM-ignoring member {member} survived the graced kill"+ try:+ assert proc.returncode is not None+ wait_until(lambda: not _pid_alive(member), timeout=3.0,+ what=f"SIGTERM-ignoring member {member} to die with the graced kill")+ finally:+ if _pid_alive(member): # reparented out of our subtree: the live-system guard refuses os.kill+ subprocess.run(["kill", "-9", str(member)], check=False)def test_fast_path_unaffected(tmp_path):