From 644d49a3c2249a2c0e26671fe5a003e446bce38d Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Wed, 5 May 2021 16:04:48 +0000 Subject: [PATCH] chore: Add stop runtime error handling --- runtime/experiments/bash_libraries/framework.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/runtime/experiments/bash_libraries/framework.sh b/runtime/experiments/bash_libraries/framework.sh index b3dbe66..68f5f00 100644 --- a/runtime/experiments/bash_libraries/framework.sh +++ b/runtime/experiments/bash_libraries/framework.sh @@ -418,7 +418,16 @@ main() { __framework_sh__stop_runtime() { printf "Stopping Runtime: " - pkill sledgert > /dev/null 2> /dev/null - pkill hey > /dev/null 2> /dev/null + # Ignoring RC of 1, as it indicates no matching process + sudo pkill sledgert > /dev/null 2> /dev/null + (($? > 1)) && { + printf "[ERR]\npkill sledgrt: %d\n" $? + exit 1 + } + sudo pkill hey > /dev/null 2> /dev/null + (($? > 1)) && { + printf "[ERR]\npkill hey: %d\n" $? + exit 1 + } printf "[OK]\n" }