mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-12 13:52:15 +00:00
Main's rewritten test_tui_npm_install.py tests call _make_tui_argv expecting the Ink/npm flow unconditionally; with the dual-engine dispatch merged in, _resolve_tui_engine() auto-selects opentui whenever ui-opentui/dist is built in the repo, routing the call away from the path under test (first subprocess became 'node --version' instead of 'npm run build'). Pin the engine to ink via an autouse fixture, mirroring the existing pinning precedent in test_tui_resume_flow.py.
21 lines
694 B
Python
21 lines
694 B
Python
import psutil
|
|
|
|
from tui_gateway import slash_worker
|
|
|
|
|
|
def test_is_orphaned_true_when_ppid_changes():
|
|
# Our parent went away and we were reparented to a subreaper/init.
|
|
assert slash_worker._is_orphaned(1234, 1.0, getppid=lambda: 999999) is True
|
|
|
|
|
|
def test_is_orphaned_true_when_parent_create_time_mismatch():
|
|
# Same ppid but a different create_time means the PID was reused.
|
|
me = psutil.Process()
|
|
assert slash_worker._is_orphaned(me.pid, 0.0, getppid=lambda: me.pid) is True
|
|
|
|
|
|
def test_is_orphaned_false_when_parent_alive_and_matches():
|
|
me = psutil.Process()
|
|
assert (
|
|
slash_worker._is_orphaned(me.pid, me.create_time(), getppid=lambda: me.pid) is False
|
|
)
|