Commit 02726cb6 authored by Mark Andrews's avatar Mark Andrews
Browse files

Add timeout to url get requests

to prevent the system test taking forever on failures.
parent 0dded90a
Pipeline #73538 passed with stages
in 18 minutes and 31 seconds
......@@ -22,7 +22,8 @@ from helper import fmt
# JSON helper functions
def fetch_zones_json(statsip, statsport):
r = requests.get("http://{}:{}/json/v1/zones".format(statsip, statsport))
r = requests.get("http://{}:{}/json/v1/zones".format(statsip, statsport),
timeout=600)
assert r.status_code == 200
data = r.json()
......@@ -31,7 +32,8 @@ def fetch_zones_json(statsip, statsport):
def fetch_traffic_json(statsip, statsport):
r = requests.get("http://{}:{}/json/v1/traffic".format(statsip, statsport))
r = requests.get("http://{}:{}/json/v1/traffic".format(statsip, statsport),
timeout=600)
assert r.status_code == 200
data = r.json()
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment