Skip to content

Commit

Permalink
4 retries on CI, 1s sleep (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
mixonic authored Dec 9, 2021
1 parent 8fff4c7 commit 4a75d99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/run-tests-with-retry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function retry {
command="$*"
retval=1
attempt=1
until [[ $retval -eq 0 ]] || [[ $attempt -gt 3 ]]; do
until [[ $retval -eq 0 ]] || [[ $attempt -gt 4 ]]; do
# Execute inside of a subshell in case parent
# script is running with "set -e"
(
Expand All @@ -15,10 +15,10 @@ function retry {
attempt=$(( $attempt + 1 ))
if [[ $retval -ne 0 ]]; then
# If there was an error wait 10 seconds
sleep 10
sleep 1
fi
done
if [[ $retval -ne 0 ]] && [[ $attempt -gt 3 ]]; then
if [[ $retval -ne 0 ]] && [[ $attempt -gt 4 ]]; then
# Something is fubar, go ahead and exit
exit $retval
fi
Expand Down

0 comments on commit 4a75d99

Please sign in to comment.