aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting/core
diff options
context:
space:
mode:
Diffstat (limited to 'xtesting/core')
-rw-r--r--xtesting/core/campaign.py3
-rw-r--r--xtesting/core/testcase.py5
2 files changed, 5 insertions, 3 deletions
diff --git a/xtesting/core/campaign.py b/xtesting/core/campaign.py
index 901df587..98b2f1a8 100644
--- a/xtesting/core/campaign.py
+++ b/xtesting/core/campaign.py
@@ -70,7 +70,8 @@ class Campaign():
url = env.get('TEST_DB_URL')
req = requests.get(
f"{url}?build_tag={env.get('BUILD_TAG')}",
- headers=testcase.TestCase.headers)
+ headers=testcase.TestCase.headers,
+ timeout=10)
req.raise_for_status()
output = req.json()
Campaign.__logger.debug("data from DB: \n%s", output)
diff --git a/xtesting/core/testcase.py b/xtesting/core/testcase.py
index b44ed793..380adc5e 100644
--- a/xtesting/core/testcase.py
+++ b/xtesting/core/testcase.py
@@ -149,7 +149,7 @@ class TestCase(metaclass=abc.ABCMeta):
self.__logger.error("Please run test before checking the results")
return TestCase.EX_TESTCASE_FAILED
- def check_requirements(self): # pylint: disable=no-self-use
+ def check_requirements(self):
"""Check the requirements of the test case.
It can be overriden on purpose.
@@ -235,7 +235,8 @@ class TestCase(metaclass=abc.ABCMeta):
data["version"] = "unknown"
req = requests.post(
url, data=json.dumps(data, sort_keys=True),
- headers=self.headers)
+ headers=self.headers,
+ timeout=10)
req.raise_for_status()
if urlparse(url).scheme != "file":
# href must be postprocessed as OPNFV testapi is misconfigured