Skip to content

The agent that grows with you

fix(tests): stop test_status takeover test from SIGTERMing pytest

Tekniume14e625d1c87
diff --git a/tests/gateway/test_status.py b/tests/gateway/test_status.py
index 542afd91d26..7460d7f2916 100644
--- a/tests/gateway/test_status.py
+++ b/tests/gateway/test_status.py
@@ -1251,6 +1251,10 @@ class TestScopedLockTakeover:
"_read_process_cmdline",
lambda _pid: "python -m hermes_cli.main gateway run",
)
+ # Fake PID 4242 can be a live ancestor of this worker on CI; a real
+ # psutil snapshot of its descendants would include pytest itself and
+ # reap_gateway_children would SIGTERM the test process.
+ monkeypatch.setattr(status, "_snapshot_gateway_children", lambda _pid: [])
calls = []
def terminate(pid, *, force=False):