Skip to content

Commit 922410c

Browse files
sbryngelsonclaude
andcommitted
Gate --only-changes on PRs only, add push retry in commit-cache
--only-changes must not run on master pushes: merge-base would diff master against itself, find no changes, and skip all tests. Gate behind GITHUB_EVENT_NAME == pull_request in all test scripts. Add retry loop (3 attempts) for git push in commit-cache to handle concurrent updates from simultaneous rebuild-cache completions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a398834 commit 922410c

4 files changed

Lines changed: 30 additions & 8 deletions

File tree

.github/workflows/frontier/test.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@ if [ -n "$job_shard" ]; then
1818
shard_opts="--shard $job_shard"
1919
fi
2020

21+
# Only prune tests on PRs; master pushes must run the full suite.
22+
prune_flag=""
23+
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
24+
prune_flag="--only-changes"
25+
fi
26+
2127
if [ "$job_device" = "gpu" ]; then
2228
rdma_opts=""
2329
if [ "$job_cluster" = "frontier" ]; then
2430
rdma_opts="--rdma-mpi"
2531
fi
26-
./mfc.sh test -v -a $rdma_opts --max-attempts 3 --only-changes -j $ngpus $device_opts $shard_opts -- -c $job_cluster
32+
./mfc.sh test -v -a $rdma_opts --max-attempts 3 $prune_flag -j $ngpus $device_opts $shard_opts -- -c $job_cluster
2733
else
28-
./mfc.sh test -v -a --max-attempts 3 --only-changes -j 32 --no-gpu $shard_opts -- -c $job_cluster
34+
./mfc.sh test -v -a --max-attempts 3 $prune_flag -j 32 --no-gpu $shard_opts -- -c $job_cluster
2935
fi

.github/workflows/frontier_amd/test.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@ if [ -n "$job_shard" ]; then
1818
shard_opts="--shard $job_shard"
1919
fi
2020

21+
# Only prune tests on PRs; master pushes must run the full suite.
22+
prune_flag=""
23+
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
24+
prune_flag="--only-changes"
25+
fi
26+
2127
if [ "$job_device" = "gpu" ]; then
2228
rdma_opts=""
2329
if [ "$job_cluster" = "frontier" ]; then
2430
rdma_opts="--rdma-mpi"
2531
fi
26-
./mfc.sh test -v -a $rdma_opts --max-attempts 3 --only-changes -j $ngpus $device_opts $shard_opts -- -c $job_cluster
32+
./mfc.sh test -v -a $rdma_opts --max-attempts 3 $prune_flag -j $ngpus $device_opts $shard_opts -- -c $job_cluster
2733
else
28-
./mfc.sh test -v -a --max-attempts 3 --only-changes -j 32 --no-gpu $shard_opts -- -c $job_cluster
34+
./mfc.sh test -v -a --max-attempts 3 $prune_flag -j 32 --no-gpu $shard_opts -- -c $job_cluster
2935
fi

.github/workflows/phoenix/test.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,10 @@ if [ "$job_device" = "gpu" ]; then
6262
n_test_threads=`expr $gpu_count \* 2`
6363
fi
6464

65-
./mfc.sh test -v --max-attempts 3 --only-changes -a -j $n_test_threads $device_opts -- -c phoenix
65+
# Only prune tests on PRs; master pushes must run the full suite.
66+
prune_flag=""
67+
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
68+
prune_flag="--only-changes"
69+
fi
70+
71+
./mfc.sh test -v --max-attempts 3 $prune_flag -a -j $n_test_threads $device_opts -- -c phoenix

.github/workflows/test.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ jobs:
211211
run: |
212212
rm -f tests/failed_uuids.txt
213213
TEST_EXIT=0
214-
/bin/bash mfc.sh test -v --max-attempts 3 -j "$(nproc)" --only-changes $TEST_ALL $TEST_PCT || TEST_EXIT=$?
214+
/bin/bash mfc.sh test -v --max-attempts 3 -j "$(nproc)" $ONLY_CHANGES $TEST_ALL $TEST_PCT || TEST_EXIT=$?
215215
216216
# Retry only if a small number of tests failed (sporadic failures)
217217
if [ -s tests/failed_uuids.txt ]; then
@@ -232,6 +232,7 @@ jobs:
232232
env:
233233
TEST_ALL: ${{ matrix.mpi == 'mpi' && '--test-all' || '' }}
234234
TEST_PCT: ${{ matrix.debug == 'debug' && '-% 20' || '' }}
235+
ONLY_CHANGES: ${{ github.event_name == 'pull_request' && '--only-changes' || '' }}
235236

236237
self:
237238
name: "${{ matrix.cluster_name }} (${{ matrix.device }}${{ matrix.interface != 'none' && format('-{0}', matrix.interface) || '' }}${{ matrix.shard != '' && format(' [{0}]', matrix.shard) || '' }})"
@@ -403,8 +404,11 @@ jobs:
403404
git commit -m "Regenerate gcov coverage cache
404405
405406
Automatically rebuilt because cases.py changed."
406-
git pull --rebase
407-
git push
407+
for i in 1 2 3; do
408+
git pull --rebase && git push && break
409+
echo "Push attempt $i failed, retrying in 5s..."
410+
sleep 5
411+
done
408412
echo "pushed=true" >> "$GITHUB_OUTPUT"
409413
fi
410414

0 commit comments

Comments
 (0)