Skip to content

Commit bceca04

Browse files
sbryngelsonclaude
andcommitted
Fix CI edge cases: guard os.remove, skip bare -- flag, use -s for empty file check
- Wrap os.remove() in try/except OSError on abort path so permission errors don't mask the real MFCException - Only pass --precision flag when matrix.precision is non-empty to avoid invalid bare -- argument - Use -s instead of -f for failed_uuids.txt to skip retry when file exists but is empty Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 788e88a commit bceca04

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ jobs:
138138

139139
- name: Build
140140
run: |
141-
/bin/bash mfc.sh test -v --dry-run -j "$(nproc)" --${{ matrix.debug }} --${{ matrix.mpi }} --${{ matrix.precision }} $TEST_ALL
141+
/bin/bash mfc.sh test -v --dry-run -j "$(nproc)" --${{ matrix.debug }} --${{ matrix.mpi }} ${{ matrix.precision != '' && format('--{0}', matrix.precision) || '' }} $TEST_ALL
142142
env:
143143
TEST_ALL: ${{ matrix.mpi == 'mpi' && '--test-all' || '' }}
144144

@@ -149,7 +149,7 @@ jobs:
149149
/bin/bash mfc.sh test -v --max-attempts 3 -j "$(nproc)" $TEST_ALL $TEST_PCT || TEST_EXIT=$?
150150
151151
# Retry only if a small number of tests failed (sporadic failures)
152-
if [ -f tests/failed_uuids.txt ]; then
152+
if [ -s tests/failed_uuids.txt ]; then
153153
NUM_FAILED=$(wc -l < tests/failed_uuids.txt)
154154
if [ "$NUM_FAILED" -gt 0 ] && [ "$NUM_FAILED" -le 5 ]; then
155155
FAILED=$(cat tests/failed_uuids.txt | tr '\n' ' ')

toolchain/mfc/test/test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,11 @@ def test():
192192
if abort_tests.is_set():
193193
# Clean up stale failed_uuids.txt so CI doesn't retry wrong tests
194194
failed_uuids_path = os.path.join(common.MFC_TEST_DIR, "failed_uuids.txt")
195-
if os.path.exists(failed_uuids_path):
196-
os.remove(failed_uuids_path)
195+
try:
196+
if os.path.exists(failed_uuids_path):
197+
os.remove(failed_uuids_path)
198+
except OSError:
199+
pass
197200

198201
total_completed = nFAIL + nPASS
199202
cons.print()

0 commit comments

Comments
 (0)