jobs test to detect zombies before running

If there is any zombie process, the jobs.fish test will fail. Add an
explicit check to report when this happens.
This commit is contained in:
ridiculousfish 2020-09-13 19:25:30 -07:00
parent 2a8e104cc8
commit 1fd9debaad

View file

@ -1,5 +1,15 @@
#RUN: %fish %s
# Ensure there's no zombies before we start, otherwise the tests will mysteriously fail.
set zombies_among_us (ps -o stat | string match 'Z*' | count)
[ "$zombies_among_us" -eq "0" ]
or begin
echo "Found existing zombie processes. Clean up zombies before running this test."
exit 1
end
echo "All clear of zombies."
# CHECK: All clear of zombies.
# Verify zombies are not left by disown (#7183, #5342)
# Do this first to avoid colliding with the other disowned processes below, which may
# still be running at the end of the script