test: make TEST-07-PID1.issue-14566 more robust (#42798)

e.g.:
https://artifacts.dev.testing-farm.io/f5150e83-eccf-4d84-aa8b-ff25cd7a3cb4/
This commit is contained in:
Luca Boccassi
2026-06-29 15:16:39 +01:00
committed by GitHub
3 changed files with 7 additions and 11 deletions
@@ -3,6 +3,8 @@
Description=Issue 14566 Repro
[Service]
Type=notify
NotifyAccess=all
ExecStart=/usr/lib/systemd/tests/testdata/TEST-07-PID1.units/%N.sh
ExecStopPost=true
KillMode=mixed
@@ -2,5 +2,6 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
sleep infinity &
echo $! >/leakedtestpid
echo $! >/run/leakedtestpid
systemd-notify --ready
wait $!
+3 -10
View File
@@ -6,21 +6,14 @@ set -o pipefail
# Test that KillMode=mixed does not leave left over processes with ExecStopPost=
# Issue: https://github.com/systemd/systemd/issues/14566
if [[ -v ASAN_OPTIONS ]]; then
# Temporarily skip this test when running with sanitizers due to a deadlock
# See: https://bugzilla.redhat.com/show_bug.cgi?id=2098125
echo "Sanitizers detected, skipping the test..."
exit 0
fi
rm -f /run/leakedtestpid
systemctl start issue14566-repro
sleep 4
systemctl status issue14566-repro
leaked_pid=$(cat /leakedtestpid)
leaked_pid=$(cat /run/leakedtestpid)
systemctl stop issue14566-repro
sleep 4
timeout 30 bash -c 'while systemctl is-active issue14566-repro; do sleep .5; done'
# Leaked PID will still be around if we're buggy.
# I personally prefer to see 42.