From 6b4949034b1924fcfa4a101079bef6fe1db61ff6 Mon Sep 17 00:00:00 2001 From: Amanjeev Sethi Date: Wed, 2 Oct 2019 11:48:20 -0400 Subject: [PATCH] Revert "Removes timeout script so CI does not have false positives" This reverts commit c3ed0a1ef9013f2821eed24efcd9954600ce2b41. --- ci/build-ignore-timeouts.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 ci/build-ignore-timeouts.sh diff --git a/ci/build-ignore-timeouts.sh b/ci/build-ignore-timeouts.sh new file mode 100755 index 00000000..3ec81f62 --- /dev/null +++ b/ci/build-ignore-timeouts.sh @@ -0,0 +1,29 @@ +#!/bin/bash -x + +output=$(mktemp) + +mkdir -p book/ +cp -r $HOME/linkcheck/ book/ +RUST_LOG=mdbook_linkcheck=debug mdbook-linkcheck -s 2>&1 | tee -a $output +cp -r book/linkcheck $HOME/ + +mdbook build + +result=${PIPESTATUS[0]} + +# if passed, great! +if [ "$result" -eq "0" ] ; then + exit 0 ; +fi + +errors=$(cat $output | sed -n 's/There \(was\|were\) \([0-9]\+\).*$/\2/p') +timeouts=$(cat $output | grep "error while fetching" | wc -l) + +# if all errors are timeouts, ignore them... +if [ "$errors" -eq "$timeouts" ] ; then + echo "Ignoring $timeouts timeouts"; + exit 0; +else + echo "Non-timeout errors found"; + exit 1; +fi