Merge branch 'rerun-test-on-asan-failure'

Try to work around a spurious failure in ASAN builds on GitHub Actions.

See https://github.com/wxWidgets/wxWidgets/pull/2217
This commit is contained in:
Vadim Zeitlin 2021-02-05 21:38:42 +01:00
commit 49fcd34335

View File

@ -180,12 +180,21 @@ jobs:
- name: Testing - name: Testing
if: matrix.skip_testing != true if: matrix.skip_testing != true
working-directory: tests
run: | run: |
echo 'Testing...' # Explicitly use bash because /bin/sh doesn't have pipefail option
pushd tests /bin/bash -o pipefail -c './test 2>&1 | tee test.out'
./test || rc=$? rc=$?
popd if [ ${{ matrix.use_asan }} ]; then
if [ -n "$rc" ]; then # Work around spurious crashes by running the test again.
# See https://github.com/google/sanitizers/issues/1353
if fgrep -q 'LeakSanitizer has encountered a fatal error' test.out; then
echo '+++ Rerunning the tests once again after LeakSanitizer crash +++'
./test
rc=$?
fi
fi
if [ "$rc" != 0 ]; then
echo '*** Tests failed, contents of httpbin.log follows: ***' echo '*** Tests failed, contents of httpbin.log follows: ***'
echo '-----------------------------------------------------------' echo '-----------------------------------------------------------'
cat httpbin.log cat httpbin.log