From 9a006f3a681a1d35f0801bbd31138f61ba0cec1f Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Mon, 24 Jul 2017 13:51:30 -0300 Subject: [PATCH] add check to see if process is running because when we interrupt the tests via ^C, the signal also kills the background process --- scripts/test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/test.sh b/scripts/test.sh index 2890ab61b..c778cda02 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -4,8 +4,8 @@ trap cleanup EXIT cleanup() { - # Kill the testrpc instance that we started (if we started one). - if [ -n "$testrpc_pid" ]; then + # Kill the testrpc instance that we started (if we started one and if it's still running). + if [ -n "$testrpc_pid" ] && ps -p $testrpc_pid > /dev/null; then kill -9 $testrpc_pid fi }