Skip to content

Commit 3a02c0f

Browse files
committed
ci: improve retry logic - only retry on timeout, show exit codes
1 parent 5969905 commit 3a02c0f

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,17 +271,28 @@ jobs:
271271
- name: Run harness tests on iOS
272272
working-directory: example
273273
run: |
274-
# Retry up to 3 times due to flaky harness connection
274+
# Retry up to 3 times only on timeout (exit code 124)
275275
for attempt in 1 2 3; do
276-
echo "Attempt $attempt of 3"
277-
if yarn test:harness:ios --verbose --testTimeout 120000; then
276+
echo "=== Attempt $attempt of 3 ==="
277+
set +e
278+
timeout 180 yarn test:harness:ios --verbose --testTimeout 120000
279+
exit_code=$?
280+
set -e
281+
282+
echo "Exit code: $exit_code"
283+
284+
if [ $exit_code -eq 0 ]; then
278285
echo "Tests passed on attempt $attempt"
279286
exit 0
287+
elif [ $exit_code -eq 124 ]; then
288+
echo "Timeout on attempt $attempt, retrying..."
289+
sleep 5
290+
else
291+
echo "Tests failed with exit code $exit_code (not retrying)"
292+
exit $exit_code
280293
fi
281-
echo "Attempt $attempt failed, retrying..."
282-
sleep 5
283294
done
284-
echo "All attempts failed"
295+
echo "All attempts timed out"
285296
exit 1
286297
287298
- name: Debug - Check for console logs

0 commit comments

Comments
 (0)