Skip to content

Commit 7b4c02c

Browse files
committed
Added retry for docker tests
1 parent 3409036 commit 7b4c02c

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,4 @@ jobs:
125125
git config --global user.name "$GITHUB_ACTOR"
126126
git config --global user.email "<>"
127127
128-
./run.sh
128+
./run_retry.sh

app-tests/run_retry.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
# Reduce flaky tests by retrying them
3+
4+
MAX_RETRIES=5
5+
RETRY_COUNT=0
6+
7+
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
8+
echo "Running test (attempt $((RETRY_COUNT+1)) of $MAX_RETRIES)..."
9+
./run-your-tests-command.sh && break
10+
RETRY_COUNT=$((RETRY_COUNT + 1))
11+
echo "Test failed, retrying..."
12+
done
13+
14+
if [ $RETRY_COUNT -eq $MAX_RETRIES ]; then
15+
echo "Tests failed after $MAX_RETRIES attempts."
16+
exit 1
17+
fi
18+
19+
echo "Tests passed successfully."

0 commit comments

Comments
 (0)