From 1aae6e26ca935fa423938fdb6421fc04f4d91f7f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 5 Feb 2021 18:56:27 +0100 Subject: [PATCH 1/3] Remove useless echo from GitHub CI script "Testing" is already shown as the step title. --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3d1c3bd31..1c073744f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,7 +181,6 @@ jobs: - name: Testing if: matrix.skip_testing != true run: | - echo 'Testing...' pushd tests ./test || rc=$? popd From 53ece3c2edff0733461c40b811e94c61128e5974 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 5 Feb 2021 19:04:14 +0100 Subject: [PATCH 2/3] Don't use pushd/popd unnecessarily Each step executes in its own shell, so it's not necessary to restore the previous working directory and a simple "cd" would do just fine but, in fact, we don't even need this as we can just set the working directory at the step level. --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c073744f3..d94756073a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,10 +180,9 @@ jobs: - name: Testing if: matrix.skip_testing != true + working-directory: tests run: | - pushd tests ./test || rc=$? - popd if [ -n "$rc" ]; then echo '*** Tests failed, contents of httpbin.log follows: ***' echo '-----------------------------------------------------------' From 211cde11d40b6d5b07da4c9a71801d40824068af Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 5 Feb 2021 19:14:06 +0100 Subject: [PATCH 3/3] Rerun the test if LeakSanitizer crashed while running it This crash (see https://github.com/google/sanitizers/issues/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. --- .github/workflows/ci.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d94756073a..0bb197a527 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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