Skip to content

Commit 7bd3567

Browse files
andrewdacenkofacebook-github-bot
authored andcommitted
Retry only failed Fantom tests instead of full suite on CI
Summary: Changelog: [Internal] The Fantom CI retry loop previously re-ran the entire test suite on each attempt. This wastes time and can introduce new flaky failures that weren't in the original run (e.g., a FlatList race condition appearing on attempt 2 but not attempt 1). This changes the retry logic to use Jest's `--onlyFailures` flag on attempts 2 and 3, so only the test suites that actually failed get re-run. For example, if 1 out of 99 suites fails with a SIGSEGV, the retry runs just that 1 suite instead of all 99 — reducing retry time from ~80s to seconds. Differential Revision: D100618771
1 parent 7efb4b5 commit 7bd3567

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/actions/run-fantom-tests/action.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,17 @@ runs:
2727
run: |
2828
for attempt in 1 2 3; do
2929
echo "Attempt $attempt of 3"
30-
if yarn fantom; then
31-
exit 0
30+
if [ "$attempt" -eq 1 ]; then
31+
if yarn fantom; then
32+
exit 0
33+
fi
34+
else
35+
if yarn fantom --onlyFailures; then
36+
exit 0
37+
fi
3238
fi
3339
if [ "$attempt" -lt 3 ]; then
34-
echo "Attempt $attempt failed. Retrying..."
40+
echo "Attempt $attempt failed. Retrying only failed tests..."
3541
fi
3642
done
3743
echo "All 3 attempts failed."

0 commit comments

Comments
 (0)