This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new ea10f4fb773 Rerun flaky SSHRemoteJobOperator kill test on
process-group races (#69384)
ea10f4fb773 is described below
commit ea10f4fb773c6d4bfbcb9e9e4d0803c54d602fad
Author: Shahar Epstein <[email protected]>
AuthorDate: Sun Jul 5 23:26:27 2026 +0300
Rerun flaky SSHRemoteJobOperator kill test on process-group races (#69384)
test_kill_terminates_whole_job_tree intermittently fails its pre-kill
check on CI: the wrapper records $! expecting it to equal the job PGID,
but setsid only skips forking when the launching shell is not a
process-group leader. On some runners it forks, so $! is the short-lived
setsid parent and the job's real group is empty by the time pgrep -g
runs. Rerun on a fresh draw so the environment-dependent race does not
fail unrelated PRs.
---
providers/ssh/tests/unit/ssh/utils/test_remote_job.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/providers/ssh/tests/unit/ssh/utils/test_remote_job.py
b/providers/ssh/tests/unit/ssh/utils/test_remote_job.py
index 4e7eca9b697..56fe5d7abb3 100644
--- a/providers/ssh/tests/unit/ssh/utils/test_remote_job.py
+++ b/providers/ssh/tests/unit/ssh/utils/test_remote_job.py
@@ -271,6 +271,10 @@ class TestPosixKillBehaviour:
# 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.