Retry the integration setup on connection error
Sometimes there are network errors communicating with pypi during a long running (1h+) integration gate job. This causes the job to fail, and wastes a lot of time re-running the job to get it to pass. This change makes it less likely to fail, as if there is a timeout or socket error, the integration setup will retry. Change-Id: Ic4c888626699eb710e85e3bdc48dd6ee74bdf024
This commit is contained in:
parent
4cecec5c78
commit
22a68b4c25
@ -55,9 +55,25 @@ EOF
|
||||
cat <<EOF > setup.py
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['pbr'],
|
||||
pbr=True)
|
||||
try:
|
||||
from requests import Timeout
|
||||
except ImportError:
|
||||
from pip._vendor.requests import Timeout
|
||||
|
||||
from socket import error as SocketError
|
||||
|
||||
# Some environments have network issues that drop connections to pypi
|
||||
# when running integration tests, so we retry here so that hour-long
|
||||
# test runs are less likely to fail randomly.
|
||||
try:
|
||||
setuptools.setup(
|
||||
setup_requires=['pbr'],
|
||||
pbr=True)
|
||||
except (SocketError, Timeout):
|
||||
setuptools.setup(
|
||||
setup_requires=['pbr'],
|
||||
pbr=True)
|
||||
|
||||
EOF
|
||||
|
||||
mkdir test_project
|
||||
|
Loading…
Reference in New Issue
Block a user