Skip to content

Commit

Permalink
Added retry for docker tests (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
danyi1212 authored Nov 18, 2024
1 parent 3409036 commit ea0bbb8
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion app-tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,20 @@ function main {
# TODO: Test statistics feature again after broadcaster restart (should first fix statistics bug)
}

main
# Retry test in case of failure to avoid flakiness
MAX_RETRIES=5
RETRY_COUNT=0

while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
echo "Running test (attempt $((RETRY_COUNT+1)) of $MAX_RETRIES)..."
main && break
RETRY_COUNT=$((RETRY_COUNT + 1))
echo "Test failed, retrying..."
done

if [ $RETRY_COUNT -eq $MAX_RETRIES ]; then
echo "Tests failed after $MAX_RETRIES attempts."
exit 1
fi

echo "Tests passed successfully."

0 comments on commit ea0bbb8

Please sign in to comment.