Skip to content

Commit 86ce9df

Browse files
gnachmanclaude
andcommitted
Only retry for flaky ibtoold crashes, not real test failures
- Detect ibtoold/asset catalog crashes by checking build output - Only retry when the specific flaky error is found - Exit immediately on real test failures (no wasted retries) - Use GitHub annotations to clearly label failure types Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7582caa commit 86ce9df

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

.github/workflows/test.yml

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,49 @@ jobs:
2929
3030
- name: Run tests
3131
run: |
32-
# Retry up to 3 times to handle flaky ibtoold crashes
32+
# Retry up to 3 times, but only for flaky ibtoold/asset catalog crashes
3333
for attempt in 1 2 3; do
34-
echo "Attempt $attempt of 3"
35-
rm -rf TestResults.xcresult
36-
if xcodebuild test \
34+
echo "::group::Attempt $attempt of 3"
35+
rm -rf TestResults.xcresult build_output.txt
36+
37+
# Run xcodebuild and capture output
38+
set +e
39+
xcodebuild test \
3740
-project iTerm2.xcodeproj \
3841
-scheme ModernTests \
3942
-parallel-testing-enabled NO \
4043
-resultBundlePath TestResults.xcresult \
4144
CODE_SIGN_IDENTITY="" \
4245
CODE_SIGNING_REQUIRED=NO \
43-
CODE_SIGNING_ALLOWED=NO; then
46+
CODE_SIGNING_ALLOWED=NO 2>&1 | tee build_output.txt
47+
exit_code=$?
48+
set -e
49+
echo "::endgroup::"
50+
51+
if [ $exit_code -eq 0 ]; then
4452
echo "Tests passed on attempt $attempt"
4553
exit 0
4654
fi
47-
echo "Attempt $attempt failed"
48-
killall ibtoold 2>/dev/null || true
49-
killall AssetCatalogSimulatorAgent 2>/dev/null || true
50-
sleep 5
55+
56+
# Check if this is a flaky ibtoold/asset catalog crash
57+
if grep -q "CompileAssetCatalogVariant failed\|IBPlatformToolFailureException\|The tool closed the connection" build_output.txt; then
58+
echo "::warning::Attempt $attempt failed due to flaky ibtoold crash (known Xcode 26.2 issue)"
59+
if [ $attempt -lt 3 ]; then
60+
echo "Retrying..."
61+
killall ibtoold 2>/dev/null || true
62+
killall AssetCatalogSimulatorAgent 2>/dev/null || true
63+
sleep 5
64+
continue
65+
else
66+
echo "::error::All 3 attempts failed due to flaky ibtoold crashes"
67+
exit 1
68+
fi
69+
else
70+
# Real test failure - don't retry
71+
echo "::error::Tests failed (not a flaky ibtoold issue)"
72+
exit 1
73+
fi
5174
done
52-
echo "All 3 attempts failed"
53-
exit 1
5475
5576
- name: Upload test results
5677
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)