mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-12 09:17:44 +03:00
e00e2e0b50
Give systemd a chance to process the stop event before checking if the
PID has indeed leaked. This should fix the intermittent test fails in CI
even with a fixed systemd version, like this one:
```
Apr 08 10:22:09 testsuite-47.sh[345]: ++ cat /leakedtestpid
Apr 08 10:22:09 testsuite-47.sh[334]: + leaked_pid=342
Apr 08 10:22:09 testsuite-47.sh[334]: + systemctl stop testsuite-47-repro
Apr 08 10:22:10 testsuite-47.sh[334]: + ps -p 342
Apr 08 10:22:10 testsuite-47.sh[348]: PID TTY TIME CMD
Apr 08 10:22:10 testsuite-47.sh[348]: 342 ? 00:00:00 sleep
Apr 08 10:22:10 testsuite-47.sh[334]: + exit 42
```
Followup to 197298ff9f
26 lines
443 B
Bash
Executable File
26 lines
443 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -ex
|
|
set -o pipefail
|
|
|
|
systemd-analyze log-level debug
|
|
systemd-analyze log-target console
|
|
|
|
systemctl start testsuite-47-repro
|
|
sleep 1
|
|
systemctl status testsuite-47-repro
|
|
|
|
leaked_pid=$(cat /leakedtestpid)
|
|
|
|
systemctl stop testsuite-47-repro
|
|
sleep 1
|
|
|
|
# Leaked PID will still be around if we're buggy.
|
|
# I personally prefer to see 42.
|
|
ps -p "$leaked_pid" && exit 42
|
|
|
|
systemd-analyze log-level info
|
|
|
|
echo OK > /testok
|
|
|
|
exit 0
|