Skip to content

Commit

Permalink
Rerun the test if LeakSanitizer crashed while running it
Browse files Browse the repository at this point in the history
This crash (see google/sanitizers#1353)
happens sporadically but regularly enough to be annoying, so try to work
around it by rerunning the test and hope that it doesn't happen twice in
a row.
  • Loading branch information
vadz committed Feb 5, 2021
1 parent 53ece3c commit 211cde1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,19 @@ jobs:
if: matrix.skip_testing != true
working-directory: tests
run: |
./test || rc=$?
if [ -n "$rc" ]; then
# Explicitly use bash because /bin/sh doesn't have pipefail option
/bin/bash -o pipefail -c './test 2>&1 | tee test.out'
rc=$?
if [ ${{ matrix.use_asan }} ]; 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 '-----------------------------------------------------------'
cat httpbin.log
Expand Down

0 comments on commit 211cde1

Please sign in to comment.