Skip to content

Commit

Permalink
Only kill processes in integration test if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmitterdorfer committed Jun 14, 2018
1 parent 0c65771 commit 2af6db9
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ function kill_rally_processes {
# kill all lingering Rally instances that might still be hanging
set +e
RUNNING_RALLY_PROCESSES=$(ps -ef | egrep "[e]srally" | awk '{print $2}')
for p in "${RUNNING_RALLY_PROCESSES}"
do
echo "kill -9 ${p}"
kill -9 ${p}
done
if [ -n "${RUNNING_RALLY_PROCESSES}" ]; then
for p in "${RUNNING_RALLY_PROCESSES}"
do
kill -9 ${p}
done
fi
set -e
}

Expand All @@ -55,10 +56,12 @@ function kill_related_es_processes {
set +e
# killall matching ES instances - we cannot use killall as we also want to ensure "rally" is "somewhere" in the command line.
RUNNING_RALLY_ES_PROCESSES=$(jps -v | egrep ".*java.*rally" | awk '{print $1}')
for p in "${RUNNING_RALLY_ES_PROCESSES}"
do
kill -9 ${p}
done
if [ -n "${RUNNING_RALLY_ES_PROCESSES}" ]; then
for p in "${RUNNING_RALLY_ES_PROCESSES}"
do
kill -9 ${p}
done
fi
set -e
}

Expand Down

0 comments on commit 2af6db9

Please sign in to comment.