generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): multiple integration tests per shard in CI (#3796)
- Loading branch information
1 parent
b55e248
commit c765fe2
Showing
4 changed files
with
27 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
# # | ||
# Retry a command until it succeeds or the maximum number of retries is reached. | ||
# Usage: retry <max-retries> <command> | ||
|
||
set -euo pipefail | ||
|
||
max_retries=${1:-} | ||
shift | ||
|
||
for i in $(seq 1 "$max_retries"); do | ||
echo "$@" | ||
if "$@"; then | ||
exit 0 | ||
fi | ||
if [ "$i" -eq "$max_retries" ]; then | ||
exit 1 | ||
fi | ||
echo "Failed, retrying in 5 seconds..." | ||
sleep 5 | ||
done |