mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-09-05 17:32:26 +00:00
Improve spec test execution by adding retry logic for transient errors (#4393)
This commit is contained in:
parent
ea408ab6c0
commit
64cafaff1e
44
.github/workflows/compilation_on_sgx.yml
vendored
44
.github/workflows/compilation_on_sgx.yml
vendored
|
@ -288,30 +288,24 @@ jobs:
|
|||
sudo swapon /swapfile
|
||||
sudo swapon --show
|
||||
|
||||
- name: run spec tests
|
||||
run: |
|
||||
set +e
|
||||
source /opt/intel/sgxsdk/environment
|
||||
attempts=0
|
||||
max_attempts=3
|
||||
|
||||
while [ $attempts -lt $max_attempts ]; do
|
||||
- name: run spec tests with retry
|
||||
id: run_spec_tests
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
command: |
|
||||
cd ./tests/wamr-test-suites
|
||||
source /opt/intel/sgxsdk/environment
|
||||
./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
|
||||
exitcode="$?"
|
||||
max_attempts: 3
|
||||
retry_on: error
|
||||
shell: bash
|
||||
timeout_minutes: 10
|
||||
|
||||
if [ $exitcode -eq 0 ]; then
|
||||
echo "Spec test passed"
|
||||
exit 0
|
||||
elif [ $exitcode -ne 143 ]; then
|
||||
echo "Spec test failed with error code $exitcode"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$exitcode is a known GitHub-hosted runner issue"
|
||||
echo "::notice::Re-running the spec test due to error code 143"
|
||||
attempts=$((attempts + 1))
|
||||
done
|
||||
|
||||
echo "::notice::Report an error with code 143 in SGX CI after $max_attempts attempts"
|
||||
exit 143
|
||||
working-directory: ./tests/wamr-test-suites
|
||||
- name: print test results
|
||||
run: |
|
||||
echo "Test results:"
|
||||
echo "${{ steps.run_spec_tests.outputs.stdout }}"
|
||||
echo "${{ steps.run_spec_tests.outputs.stderr }}"
|
||||
echo "Exit code: ${{ steps.run_spec_tests.outputs.exit_code }}"
|
||||
echo "Exit error: ${{ steps.run_spec_tests.outputs.exit_error }}"
|
||||
shell: bash
|
||||
|
|
Loading…
Reference in New Issue
Block a user