From a1f0feb38592997064421b55da869057fffae3b1 Mon Sep 17 00:00:00 2001 From: ChakraFusion <112588066+ChakraFusion@users.noreply.github.com> Date: Mon, 5 Oct 2026 15:37:04 +0200 Subject: [PATCH] Test: fake the Linux kill path too (CI failed on ubuntu after #11) Co-Authored-By: Claude Opus 5.5 --- tests/selftest_dashboard.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/selftest_dashboard.py b/tests/selftest_dashboard.py index 9814946..2722db4 100644 --- a/tests/selftest_dashboard.py +++ b/tests/selftest_dashboard.py @@ -820,7 +820,10 @@ def _no_shutdown(req, timeout=5): llama_restart._unlock = lambda *a, **k: None coordinator.llama_slots = lambda cfg: {"is_processing": False} llama_restart.urllib.request.urlopen = _no_shutdown - llama_restart.subprocess.run = _fake_run + llama_restart.subprocess.run = _fake_run # Windows: taskkill + from opencode_hawk import hawk_linux as _hl + _saved_kill = _hl.kill_tree + _hl.kill_tree = lambda pid: _fake_run() # Linux: kill_tree import time as _t _t0 = _t.time() _res = llama_restart.restart({"llama_restart_force_after_s": 60, "llama_restart_exit_wait_s": 20}, "test") @@ -831,6 +834,10 @@ def _no_shutdown(req, timeout=5): coordinator.llama_slots = _saved_slots llama_restart.urllib.request.urlopen = _saved_urlopen llama_restart.subprocess.run = _saved_run + try: + _hl.kill_tree = _saved_kill + except NameError: + pass check("llama_restart_survives_slow_exit", bool(_res.get("ok") and _res.get("pid_new") == 5151 and len(_spawned) == 1 and _took < 15)) print(" restart result %s in %.1fs" % (_res, _took))