From f9f4fb432781f6f184d88e4bda1b8ba0001ed1a4 Mon Sep 17 00:00:00 2001 From: kshitij <82637225+kshitijk4poor@users.noreply.github.com> Date: Sun, 9 Aug 2026 12:52:19 +0530 Subject: [PATCH] test: update systemd scope assertions for start_new_session=True The #70716 regression fix changes popen_start_new_session from False to True in the systemd-scope branch. Update the assertion in test_wraps_in_systemd_scope_when_supervisor_and_available and the docstring in test_systemd_post_spawn_failure_never_kills_gateway_process_group. --- tests/tools/test_process_registry.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/tools/test_process_registry.py b/tests/tools/test_process_registry.py index 82ae7e33686d7..6009837cd2d74 100644 --- a/tests/tools/test_process_registry.py +++ b/tests/tools/test_process_registry.py @@ -1717,8 +1717,12 @@ class TestSystemdCgroupIsolation: sep_idx = argv.index("--") assert "/bin/bash" in argv[sep_idx:] assert "set +m; echo hello" in argv[sep_idx:] - # systemd-run owns session/cgroup creation — no start_new_session. - assert captured["start_new_session"] is False + # systemd-run --scope gives the worker a new cgroup but NOT a new + # session (#70716 regression: start_new_session was False, so the + # worker kept the parent's session + controlling terminal → SIGTTIN/ + # SIGTTOU stopped the TUI). start_new_session=True gives systemd-run + # (and the scoped worker below it) a private session. + assert captured["start_new_session"] is True # The session must record the unit name so kill_process can stop it. assert session.systemd_unit == f"hermes-worker-{session.id}.scope" @@ -1779,7 +1783,7 @@ class TestSystemdCgroupIsolation: def test_systemd_post_spawn_failure_never_kills_gateway_process_group( self, registry, monkeypatch ): - """The scope wrapper shares the gateway PG, so cleanup must not killpg.""" + """Cleanup must not killpg: scope teardown is the authoritative path.""" fake_popen, _captured = self._fake_popen_capture() fake_proc = fake_popen(["placeholder"])