Skip to content

Commit 8ad4789

Browse files
authored
Add error handling for sgx ci (#4222)
> Process completed with exit code 143. It will attempt to run spec test scripts three times if they end with code 143. It is a known issue with GitHub-hosted runners. Usually, increasing the swap file can help avoid it. However, sometimes error 143 still occurs. To prevent confusion, let's capture error 143 and allow the CI to pass.
1 parent 70b35f9 commit 8ad4789

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/compilation_on_sgx.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,28 @@ jobs:
290290
291291
- name: run spec tests
292292
run: |
293+
set +e
293294
source /opt/intel/sgxsdk/environment
294-
./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
295+
attempts=0
296+
max_attempts=3
297+
298+
while [ $attempts -lt $max_attempts ]; do
299+
./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
300+
exitcode="$?"
301+
302+
if [ $exitcode -eq 0 ]; then
303+
echo "Spec test passed"
304+
exit 0
305+
elif [ $exitcode -ne 143 ]; then
306+
echo "Spec test failed with error code $exitcode"
307+
exit 1
308+
fi
309+
310+
echo "$exitcode is a known GitHub-hosted runner issue"
311+
echo "::notice::Re-running the spec test due to error code 143"
312+
attempts=$((attempts + 1))
313+
done
314+
315+
echo "::notice::Report an error with code 143 in SGX CI after $max_attempts attempts"
316+
exit 143
295317
working-directory: ./tests/wamr-test-suites

0 commit comments

Comments
 (0)