diff --git a/ci/travis/install-dependencies.sh b/ci/travis/install-dependencies.sh index bed0e8465..f94161f06 100755 --- a/ci/travis/install-dependencies.sh +++ b/ci/travis/install-dependencies.sh @@ -216,7 +216,20 @@ install_dependencies() { # These packages aren't Windows-compatible pip_packages+=(blist) # https://github.com/DanielStutzbach/blist/issues/81#issue-391460716 fi - CC=gcc pip install "${pip_packages[@]}" + + # Try n times; we often encounter OpenSSL.SSL.WantReadError (or others) + # that break the entire CI job: Simply retry installation in this case + # after n seconds. + local status="0"; + local errmsg=""; + for i in {1..3}; + do + errmsg=$(CC=gcc pip install "${pip_packages[@]}" 2>&1) && break; + status=$errmsg && echo "'pip install ...' failed, will retry after n seconds!" && sleep 30; + done + if [ "$status" != "0" ]; then + echo "${status}" && return 1 + fi fi if [ "${LINT-}" = 1 ]; then