Skip to content

Commit

Permalink
BATS: When using retries, log how many iterations were needed
Browse files Browse the repository at this point in the history
Hopefully this helps us track down how close we are to exceeding the retry
count, to better identify when things are almost failing.

Signed-off-by: Mark Yen <[email protected]>
  • Loading branch information
mook-as committed Apr 25, 2024
1 parent 2ee7c23 commit 03f28b0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bats/tests/helpers/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ try() {
while true; do
run "$@"
if ((status == 0 || ++count >= max)); then
trace "$count/$max tries: $*"
break
fi
sleep "$delay"
Expand Down

0 comments on commit 03f28b0

Please sign in to comment.