From 8e6152ff2f4d40b78faf5404bdc5c450ddedf1c9 Mon Sep 17 00:00:00 2001 From: Martin Schulze Date: Wed, 11 Sep 2019 00:02:16 +0200 Subject: [PATCH] Fix missing error output from timeout The exits would prevent the printing code from running --- test/test_helper/common.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_helper/common.bash b/test/test_helper/common.bash index c8580b3e..b028cbf3 100644 --- a/test/test_helper/common.bash +++ b/test/test_helper/common.bash @@ -9,7 +9,7 @@ TEST_TIMEOUT_IN_SECONDS=${TEST_TIMEOUT_IN_SECONDS-60} function repeat_until_success_or_timeout { if ! [[ "$1" =~ ^[0-9]+$ ]]; then echo "First parameter for timeout must be an integer, recieved \"$1\"" - exit 1 + return 1 fi TIMEOUT=$1 STARTTIME=$SECONDS @@ -19,7 +19,7 @@ function repeat_until_success_or_timeout { sleep 5 if [[ $(($SECONDS - $STARTTIME )) -gt $TIMEOUT ]]; then echo "Timed out on command: $@" - exit 1 + return 1 fi done }