Skip to content

The agent that grows with you

test(update): pin the ancestry check in the launchd restart-verification fixture

Maciej Lisiewski607a0b0d41e0
diff --git a/tests/hermes_cli/test_update_launchd_restart_verification.py b/tests/hermes_cli/test_update_launchd_restart_verification.py
index 8d8cc56342f..cb848ced558 100644
--- a/tests/hermes_cli/test_update_launchd_restart_verification.py
+++ b/tests/hermes_cli/test_update_launchd_restart_verification.py
@@ -173,6 +173,11 @@ def _patch_launchd_env(
monkeypatch.setattr(
gateway_cli, "launchd_gateway_labels_for_install", lambda: [LABEL]
)
+ # The gateway under test is never this updater's ancestor; a real ancestry walk would make it one
+ # whenever a fake pid (4242) happens to be a live ancestor of the worker on the host.
+ monkeypatch.setattr(
+ gateway_cli, "_is_pid_ancestor_of_current_process", lambda pid: False
+ )
calls = {"restart": 0, "verify": 0, "label": None}