From de6cb97e4b673ef1ff975eb33d73097074f14925 Mon Sep 17 00:00:00 2001 From: Who? Me?! Date: Mon, 5 Aug 2019 15:57:25 -0500 Subject: [PATCH] hack around timeouts (#416) --- src/doc/rustc-dev-guide/.travis.yml | 4 ++-- .../ci/build-ignore-timeouts.sh | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 src/doc/rustc-dev-guide/ci/build-ignore-timeouts.sh diff --git a/src/doc/rustc-dev-guide/.travis.yml b/src/doc/rustc-dev-guide/.travis.yml index fc6f4f05e571..bd72a03fc0ba 100644 --- a/src/doc/rustc-dev-guide/.travis.yml +++ b/src/doc/rustc-dev-guide/.travis.yml @@ -8,9 +8,9 @@ before_install: - MAX_LINE_LENGTH=100 bash ci/check_line_lengths.sh src/**/*.md install: - source ~/.cargo/env || true -- bash ci/install.sh +- bash -x ci/install.sh script: -- mdbook build +- bash -x ci/build-ignore-timeouts.sh - mdbook test notifications: email: 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 100644 index 000000000000..b21ce24e83f9 --- /dev/null +++ b/src/doc/rustc-dev-guide/ci/build-ignore-timeouts.sh @@ -0,0 +1,23 @@ + +output=$(mktemp) + +RUST_LOG=mdbook_linkcheck=debug mdbook build 2>&1 | tee $output + +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