simplify(compat): hermes_cli small facades — drop 7 re-exports/aliases (+relay_runtime alias module), repoint 12 callers/tests
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
Timing out a git probe must not leave helper descendants (credential helpers,
|
||||
``git-remote-https``, hook children) running after the probe returns. The
|
||||
probe spawns the child in its own process group (``process_group=0``) and
|
||||
``_kill_git_process_tree`` signals the whole group with ``os.killpg`` — but
|
||||
``kill_process_tree`` signals the whole group with ``os.killpg`` — but
|
||||
only when the child actually leads its own group, so a shared-group spawn can
|
||||
never take down unrelated processes.
|
||||
|
||||
@@ -20,7 +20,7 @@ import time
|
||||
import pytest
|
||||
|
||||
from hermes_cli import _subprocess_compat
|
||||
from hermes_cli._subprocess_compat import _kill_git_process_tree, bounded_git_probe
|
||||
from hermes_cli._subprocess_compat import bounded_git_probe, kill_process_tree
|
||||
|
||||
pytestmark = pytest.mark.skipif(
|
||||
sys.platform == "win32", reason="POSIX process-group semantics"
|
||||
@@ -94,7 +94,7 @@ def test_posix_spawn_uses_own_process_group(tmp_path):
|
||||
|
||||
|
||||
def test_group_kill_skipped_when_child_shares_our_group():
|
||||
"""_kill_git_process_tree must never killpg a group the child doesn't lead.
|
||||
"""kill_process_tree must never killpg a group the child doesn't lead.
|
||||
|
||||
Spawn WITHOUT process_group=0 (child inherits OUR group): the ownership
|
||||
check (pgid == pid) must skip the group signal, or the test process itself
|
||||
@@ -107,7 +107,7 @@ def test_group_kill_skipped_when_child_shares_our_group():
|
||||
stdin=subprocess.DEVNULL,
|
||||
)
|
||||
assert os.getpgid(proc.pid) == os.getpgid(0) # shared group precondition
|
||||
_kill_git_process_tree(proc)
|
||||
kill_process_tree(proc)
|
||||
proc.wait(timeout=5)
|
||||
# We are alive to make this assertion — killpg on our own group would have
|
||||
# taken the test runner down. The direct child is still killed.
|
||||
@@ -132,4 +132,4 @@ def test_kill_helper_swallow_all_failures():
|
||||
def kill(self):
|
||||
raise OSError("already reaped")
|
||||
|
||||
_kill_git_process_tree(_Dead()) # must not raise
|
||||
kill_process_tree(_Dead()) # must not raise
|
||||
|
||||
Reference in New Issue
Block a user