bugfix: tc037/38 multiprocessing failed sometimes 09/39009/5
authorrexlee8776 <limingjiang@huawei.com>
Thu, 10 Aug 2017 01:35:58 +0000 (01:35 +0000)
committerrexlee8776 <limingjiang@huawei.com>
Thu, 10 Aug 2017 03:52:43 +0000 (03:52 +0000)
set runner.join timeout

JIRA: YARDSTICK-771

Change-Id: Iec7d04549a45c0fbd0eb48dcaad7770fd5ca1f4e
Signed-off-by: rexlee8776 <limingjiang@huawei.com>
yardstick/benchmark/core/task.py

index 703bb6d..395f3b8 100644 (file)
@@ -38,6 +38,7 @@ output_file_default = "/tmp/yardstick.out"
 config_file = '/etc/yardstick/yardstick.conf'
 test_cases_dir_default = "tests/opnfv/test_cases/"
 LOG = logging.getLogger(__name__)
+JOIN_TIMEOUT = 60
 
 
 class Task(object):     # pragma: no cover
@@ -263,13 +264,12 @@ class Task(object):     # pragma: no cover
 
         # Wait for background runners to finish
         for runner in background_runners:
-            status = runner.join(timeout=60)
+            status = runner.join(JOIN_TIMEOUT)
             if status is None:
                 # Nuke if it did not stop nicely
                 base_runner.Runner.terminate(runner)
-                status = runner_join(runner)
-            else:
-                base_runner.Runner.release(runner)
+                runner.join(JOIN_TIMEOUT)
+            base_runner.Runner.release(runner)
 
             self.outputs.update(runner.get_output())
             result.extend(runner.get_result())