diff options
| author | Amanjeev Sethi <aj@amanjeev.com> | 2019-10-02 11:48:20 -0400 |
|---|---|---|
| committer | Who? Me?! <mark-i-m@users.noreply.github.com> | 2019-10-04 16:32:47 -0500 |
| commit | f40d71327be399c21fa0b8bc72b8a4be96ab3772 (patch) | |
| tree | c8d208f72f346440db8a568b6033146dd0b41068 /src/doc/rustc-dev-guide | |
| parent | ca97497c9e8d0dca1a15c9cac2f905a1109285f5 (diff) | |
| download | rust-f40d71327be399c21fa0b8bc72b8a4be96ab3772.tar.gz rust-f40d71327be399c21fa0b8bc72b8a4be96ab3772.zip | |
Revert "Removes timeout script so CI does not have false positives"
This reverts commit c3ed0a1ef9013f2821eed24efcd9954600ce2b41.
Diffstat (limited to 'src/doc/rustc-dev-guide')
| -rwxr-xr-x | src/doc/rustc-dev-guide/ci/build-ignore-timeouts.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/doc/rustc-dev-guide/ci/build-ignore-timeouts.sh b/src/doc/rustc-dev-guide/ci/build-ignore-timeouts.sh new file mode 100755 index 00000000000..3ec81f6245f --- /dev/null +++ b/src/doc/rustc-dev-guide/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 |
