Skip to content
Snippets Groups Projects
Verified Commit 677aa078 authored by Petr Špaček's avatar Petr Špaček Committed by Tomas Krizek
Browse files

tests: improve process cleanup after config tests

Previously exit trap executed command "kill -9" even if there were no
leftover processes and this lead to clutter in logs because kill
complained about missing arguments.

As a bonus the cleanup routine now prints information about leftover
processes.
parent 6e7a79a8
Branches
Tags
1 merge request!1000Reimplement map()
......@@ -13,8 +13,13 @@ TEST_DIR="$(dirname ${TEST_FILE})"
TMP_RUNDIR="$(mktemp -d)"
function finish {
kill -s 9 $(jobs -p) || :
rm -rf "${TMP_RUNDIR}"
if [[ "$(jobs -p)" != "" ]]
then
echo "SIGKILLing leftover processes:"
jobs -l
kill -s SIGKILL $(jobs -p)
fi
rm -rf "${TMP_RUNDIR}"
}
trap finish EXIT
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment