From: Frantisek Sumsal Date: Wed, 8 Apr 2020 10:12:46 +0000 (+0200) Subject: test: wait a bit after stopping the test service X-Git-Tag: v246-rc1~619^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15361%2Fhead;p=thirdparty%2Fsystemd.git test: wait a bit after stopping the test service 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 197298ff9fc930de450330095cc5b67d165d0801 --- diff --git a/test/units/testsuite-47.sh b/test/units/testsuite-47.sh index 09be780a680..97f86140f11 100755 --- a/test/units/testsuite-47.sh +++ b/test/units/testsuite-47.sh @@ -12,6 +12,7 @@ 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.