From c759a1b212eff3427483d7f130cdb4ba0e6630c8 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 8 Jan 2014 14:48:48 +0100 Subject: [PATCH] tests: kill all started processes on exit Just killing MongoDB is not enough, we also need to kill processes such as the cat ones used to read the fifo. Change-Id: I3fd99e333e69625e3872e24b9337cad17d46d737 --- run-tests.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/run-tests.sh b/run-tests.sh index 23c7edea6..2c3a66e0d 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -4,9 +4,7 @@ set -e function clean_exit(){ local error_code="$?" rm -rf ${MONGO_DATA} - if [ "$MONGO_PID" ]; then - kill -9 ${MONGO_PID} || true - fi + kill $(jobs -p) return $error_code } @@ -33,7 +31,6 @@ then exit 1 fi mongod --maxConns 32 --nojournal --noprealloc --smallfiles --quiet --noauth --port ${MONGO_PORT} --dbpath "${MONGO_DATA}" --bind_ip localhost --config /dev/null &>${MONGO_DATA}/out & -MONGO_PID=$! # Wait for Mongo to start listening to connections while read line do