Skip to content
Snippets Groups Projects
Unverified Commit 7bc20549 authored by Varac's avatar Varac
Browse files

Add configurable sleep interval for retry_cmd_until_success.sh

parent 61fd96b7
No related branches found
No related tags found
No related merge requests found
......@@ -867,8 +867,9 @@ kube-prometheus-stack-alerts:
before_script:
- *debug_information
script:
# Retry taiko tests multiple times until they succeed
- bash ./.gitlab/ci_scripts/retry_cmd_until_success.sh 20 unbuffer python3 -m openappstack $HOSTNAME test --apps $RESOURCE | ts -i | ts
# Retry taiko tests 60 times until they succeed,
# with a sleep interval of 10s in between tests
- bash ./.gitlab/ci_scripts/retry_cmd_until_success.sh 60 10 unbuffer python3 -m openappstack $HOSTNAME test --apps $RESOURCE | ts -i | ts
artifacts:
paths:
- test/taiko/Screenshot*
......@@ -905,7 +906,6 @@ rocketchat-taiko:
extends:
- .taiko
- .rocketchat_rules
allow_failure: true
wekan-taiko:
variables:
......
......@@ -4,22 +4,29 @@
#
# Usage:
#
# ./retry_cmd_until_success.sh [retries] [cmd]
# ./retry_cmd_until_success.sh [retries] [sleep] [cmd]
#
# Example:
#
# ./retry_cmd_until_success.sh 10 ping ix.de
# ./retry_cmd_until_success.sh 10 20 ping ix.de
retries=$1
shift
cmd=$*
if [[ ! $retries =~ ^-?[0-9]+$ ]]
then
echo "Please specify retries count."
exit 1
fi
shift
sleep_secs=$1
if [[ ! $sleep_secs =~ ^-?[0-9]+$ ]]
then
echo "Please specify sleep interval in seconds."
exit 1
fi
shift
cmd=$*
if [[ -z "$cmd" ]]
then
echo "Please specify a cmd."
......@@ -31,11 +38,11 @@ i=0
until eval $cmd
do
echo -e "return code: $?\n"
if [[ $i -ge 2 ]]
if [[ $i -ge $retries ]]
then
exit 1
fi
(( i++ ))
sleep 1
sleep $sleep_secs
echo "${i}. retry:"
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment