Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions providers/ssh/tests/unit/ssh/utils/test_remote_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ def _group_alive(pgid: int) -> bool:
# pgrep -g matches by process-group id; rc 0 => at least one member alive.
return subprocess.run(["pgrep", "-g", str(pgid)], capture_output=True, check=False).returncode == 0

# setsid only avoids forking when the launching shell is not a process-group leader; on some
# CI runners it forks, so the recorded $! is the short-lived setsid parent rather than the job
# PGID and the pre-kill pgrep -g finds an empty group. Re-launch on a fresh draw.
@pytest.mark.flaky(reruns=5)
def test_kill_terminates_whole_job_tree(self, tmp_path):
paths = RemoteJobPaths(job_id="killtree", remote_os="posix", base_dir=str(tmp_path / "jobs"))
# `sleep 300` runs as a child of the wrapper subshell -> the tree the old kill orphaned.
Expand Down