Protect vs rally infine loop 88/68388/2
authorCédric Ollivier <cedric.ollivier@orange.com>
Thu, 22 Aug 2019 14:35:10 +0000 (16:35 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Mon, 26 Aug 2019 09:51:57 +0000 (11:51 +0200)
It calls timeout (1 hour) to stop any hanging task [1].
It will be backported to Hunter and Iruya if similar failures are
detected.

[1] https://build.opnfv.org/ci/job/functest-opnfv-functest-benchmarking-latest-rally_full-run/9/console

Change-Id: I8fe89f9fa1c6c39cd8810096c1d586bdef7865a0
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
functest/opnfv_tests/openstack/rally/rally.py

index 22b508a..46c1d95 100644 (file)
@@ -67,6 +67,7 @@ class RallyBase(singlevm.VmReady2):
     visibility = 'public'
     shared_network = True
     allow_no_fip = True
+    task_timeout = '3600'
 
     def __init__(self, **kwargs):
         """Initialize RallyBase object."""
@@ -524,7 +525,8 @@ class RallyBase(singlevm.VmReady2):
         if self.file_is_empty(file_name):
             LOGGER.info('No tests for scenario "%s"', test_name)
             return False
-        self.run_cmd = (["rally", "task", "start", "--abort-on-sla-failure",
+        self.run_cmd = (["timeout", self.task_timeout,
+                         "rally", "task", "start", "--abort-on-sla-failure",
                          "--task", self.task_file, "--task-args",
                          str(self.build_task_args(test_name))])
         return True
@@ -729,6 +731,7 @@ class RallyJobs(RallyBase):
     """Rally OpenStack CI testcase implementation."""
 
     stests = ["neutron"]
+    task_timeout = '7200'
 
     def __init__(self, **kwargs):
         """Initialize RallyJobs object."""
@@ -834,7 +837,8 @@ class RallyJobs(RallyBase):
             os.makedirs(self.temp_dir)
         task_file_name = os.path.join(self.temp_dir, task_name)
         self.apply_blacklist(task, task_file_name)
-        self.run_cmd = (["rally", "task", "start", "--task", task_file_name,
+        self.run_cmd = (["timeout", self.task_timeout,
+                         "rally", "task", "start", "--task", task_file_name,
                          "--task-args", str(self.build_task_args(test_name))])
         return True