Skip to content

Commit

Permalink
test: fix the CI failure detection when rerunning the tests (#6129)
Browse files Browse the repository at this point in the history
  • Loading branch information
spacewander authored Jan 18, 2022
1 parent ebf6222 commit 70bc7f6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ci/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,17 @@ rerun_flaky_tests() {
exit 0
fi

if ! tail -1 "$1" | grep "Result: FAIL"; then
# CI failure not caused by failed test
exit 1
fi

local tests
local n_test
tests="$(awk '/^t\/.*.t\s+\(.+ Failed: .+\)/{ print $1 }' "$1")"
n_test="$(echo "$tests" | wc -l)"
if [ "$n_test" -eq 0 ] || [ "$n_test" -gt 3 ]; then
# CI failure failed test or too many tests failed
if [ "$n_test" -gt 3 ]; then
# too many tests failed
exit 1
fi

Expand Down

0 comments on commit 70bc7f6

Please sign in to comment.