Add timeout to url get requests

to prevent the system test taking forever on failures.
This commit is contained in:
Mark Andrews
2021-06-02 16:40:58 +10:00
parent 0dded90ae4
commit 02726cb66e
2 changed files with 8 additions and 4 deletions

View File

@@ -23,7 +23,8 @@ from helper import fmt
# XML helper functions
def fetch_zones_xml(statsip, statsport):
r = requests.get("http://{}:{}/xml/v3/zones".format(statsip, statsport))
r = requests.get("http://{}:{}/xml/v3/zones".format(statsip, statsport),
timeout=600)
assert r.status_code == 200
root = ET.fromstring(r.text)
@@ -47,7 +48,8 @@ def fetch_traffic_xml(statsip, statsport):
return out
r = requests.get("http://{}:{}/xml/v3/traffic".format(statsip, statsport))
r = requests.get("http://{}:{}/xml/v3/traffic".format(statsip, statsport),
timeout=600)
assert r.status_code == 200
root = ET.fromstring(r.text)