Skip to content

Commit

Permalink
Added a timeout to stop requests.get hanging on platforms with no int…
Browse files Browse the repository at this point in the history
…ernet (SciTools#3284)

* Added a 1 second timout to stop requests.get hanging on the HPC

* Amended comment to be more generic

* Changed 1 second timeout to 10 seconds.
  • Loading branch information
wilbertcs authored and lbdreyer committed Jun 3, 2019
1 parent 400abd2 commit 3237313
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/iris/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@
NC_TIME_AXIS_AVAILABLE = False

try:
requests.get('https://github.com/SciTools/iris')
# Added a timeout to stop the call to requests.get hanging when running
# on a platform which has restricted/no internet access.
requests.get('https://github.com/SciTools/iris', timeout=10.0)
INET_AVAILABLE = True
except requests.exceptions.ConnectionError:
INET_AVAILABLE = False
Expand Down

0 comments on commit 3237313

Please sign in to comment.