From 1fd9debaad46ffcf689e805b1ab9d79df53c409f Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 13 Sep 2020 19:25:30 -0700 Subject: [PATCH] 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. --- tests/checks/jobs.fish | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/checks/jobs.fish b/tests/checks/jobs.fish index 14772b3b9..9fb450709 100644 --- a/tests/checks/jobs.fish +++ b/tests/checks/jobs.fish @@ -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