The hand-over test ends every process its scene started, the login of a sign-in its runner held included #190
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/3863-tests-runner-handover-sx-leaves-its-stub"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tracker: #3863
tests/runner_handover.sxended its scene by sendingkill -9to the runners it had started: the slot processes named in the fake systemd's pid files, and the terminal runner. A runner starts each login (and each harness) in a process group of its own. So a login that a runner held when it was killed kept running, reparented to launchd. Once the test removed its root, the stub's device login (while [ ! -e "$here/approved" ]; do sleep 0.1; done) could never end, and it went on forking asleepten times a second.Which runs leak. Passing runs leak nothing: in four passing runs on s32 (one alone, three side by side), the runner itself ended the logins of "Held", which the hand-over fails, and of "Next", which the test cancels.
tests/sign_in.sxalready pins that cancel ("the runner ends its login and removes its home"). A run whose hand-over fails leaks "Held". An arm of master withLATERset to VERSION, so Update all asks no runner, fails 22 checks. "Held" keeps waiting at slot a, andcheck_terminal'skill -9of the slots orphans its login: pid 48099, ppid 1, its root gone, its cwd sign-in 1's home (/private/tmp/sak-sign-in-1-…). The leaks seen on max line up with release reviews whose hand-over versions failed the test.What changes.
end_scenereplaces both kills. It ends every process whose command names the scene's root (runners, the stub logins, the fake systemctl's held-back starts), and the process group each one leads, so a login dies together with thesleepit is waiting in.check_terminal.check_held_at_endposts a sign-in to it and waits until it iswaiting. So the test always ends with a runner that holds a login.end_scene, the test checks "once the test ends, nothing it started still runs, the login of the sign-in a runner held included". It pollspgrep -fon the root until nothing matches.Regression, fail-before and pass-after (s32, sx af8455c3,
dist/built at the head):pkill -9 -f '<root>[/]home/.sak-runner/bin/', which is what master did), fails exactly the new check:RUNNER HANDOVER FAIL (1 checks). It leaves pid 54944, the stub's device login under/tmp/sak-runner_handover-guLLd2/signin/, with ppid 1, its root gone and its cwd sign-in 3's home. That is the task's symptom. The orphan and its home were removed by hand afterwards.RUNNER HANDOVER OK. No login of its scene is left running, and no/tmp/sak-sign-in-*home is left.Gates.
fast: gate run 913 passed at95678ea2.full: gate run 916 passed at95678ea2, and gate run 917 passed at the head,45b59678. In both,tests/runner_handover.sxpassed and left no login running. Gate run 916 left the held sign-in's home under/tmp, which the second commit removes. Gate run 917 left none.Not covered. The homes of the runs whose runner the test kills mid-scene (
check_killed,check_hand_over, under/tmp/sak-run-<id>-<hex>) are still left, as before this change.