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

Use retry_cmd_until_success.sh script

parent 9ac25d35
No related branches found
No related tags found
No related merge requests found
...@@ -868,19 +868,7 @@ kube-prometheus-stack-alerts: ...@@ -868,19 +868,7 @@ kube-prometheus-stack-alerts:
- *debug_information - *debug_information
script: script:
# Retry taiko tests multiple times until they succeed # 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
set -o pipefail
i=0
until unbuffer python3 -m openappstack $HOSTNAME test --apps $RESOURCE | ts -i | ts
do
if [[ $i -ge 20 ]]
then
exit 1
fi
(( i++ ))
sleep 1
echo -e "${i}. retry:\n"
done
artifacts: artifacts:
paths: paths:
- test/taiko/Screenshot* - test/taiko/Screenshot*
......
#!/usr/bin/env bash
#
# Executes given cms multiple times until it is successful
#
# Usage:
#
# ./retry_cmd_until_success.sh [retries] [cmd]
#
# Example:
#
# ./retry_cmd_until_success.sh 10 ping ix.de
retries=$1
shift
cmd=$*
if [[ ! $retries =~ ^-?[0-9]+$ ]]
then
echo "Please specify retries count."
exit 1
fi
if [[ -z "$cmd" ]]
then
echo "Please specify a cmd."
exit 1
fi
echo "Retrying \"$cmd\" ${retries} times."
i=0
until eval $cmd
do
echo -e "return code: $?\n"
if [[ $i -ge 2 ]]
then
exit 1
fi
(( i++ ))
sleep 1
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