diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9fdbd5402898bf..d0e8e1e13181f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -149,13 +149,19 @@ jobs: run: tar xf artifacts.tar.gz && tar xf tracked.tar.gz - uses: git-for-windows/setup-git-for-windows-sdk@v1 - name: test + id: test shell: bash + timeout-minutes: 20 run: . /etc/profile && ci/run-test-slice.sh ${{matrix.nr}} 10 + - name: handle timed-out tests + if: failure() && steps.test.outcome == 'failure' && env.FAILED_TEST_ARTIFACTS == '' + shell: bash + run: . /etc/profile && . ci/lib.sh && { handle_failed_tests || test $? = 1; } - name: print test failures if: failure() && env.FAILED_TEST_ARTIFACTS != '' shell: bash run: ci/print-test-failures.sh - - name: Upload failed tests' directories + - name: Upload failed/timed-out tests' directories if: failure() && env.FAILED_TEST_ARTIFACTS != '' uses: actions/upload-artifact@v3 with: diff --git a/ci/lib.sh b/ci/lib.sh index c749b21366b950..ca8e0c16aa6605 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -180,15 +180,26 @@ handle_failed_tests () { } create_failed_test_artifacts () { + # Handle timed-out tests + for test_out in t/test-results/*.out + do + test -f "${test_out%.out}.exit" || + echo timed-out >"${test_out%.out}.exit" + done + mkdir -p t/failed-test-artifacts for test_exit in t/test-results/*.exit do - test 0 != "$(cat "$test_exit")" || continue + case "$(cat "$test_exit")" in + 0) continue;; + timed-out) label="Timed-out";; + *) label="Failed";; + esac test_name="${test_exit%.exit}" test_name="${test_name##*/}" - printf "\\e[33m\\e[1m=== Failed test: ${test_name} ===\\e[m\\n" + printf "\\e[33m\\e[1m=== ${label} test: ${test_name} ===\\e[m\\n" echo "The full logs are in the 'print test failures' step below." echo "See also the 'failed-tests-*' artifacts attached to this run." cat "t/test-results/$test_name.markup"