[Kimchi-devel] [PATCH V1 2/2] Add a timeout tunning environment variable for debug report test

Shu Ming shuming at linux.vnet.ibm.com
Thu Jan 9 10:40:33 UTC 2014


It is helpful when the timeout happens and the tester can tune it

Signed-off-by: Shu Ming <shuming at linux.vnet.ibm.com>
---
 tests/test_model.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/test_model.py b/tests/test_model.py
index dad4670..41032f7 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -614,6 +614,11 @@ class ModelTests(unittest.TestCase):
         if not inst.get_capabilities()['system_report_tool']:
             raise unittest.SkipTest("Without debug report tool")
 
+        try:
+            timeout = int(os.environ['TEST_REPORT_TIMEOUT'])
+        except (ValueError, KeyError):
+            timeout = 120
+
         namePrefix = 'unitTestReport'
         # sosreport always deletes unsual letters like '-' and '_' in the
         # generated report file name.
@@ -630,7 +635,7 @@ class ModelTests(unittest.TestCase):
                 task = inst.debugreports_create({'name': reportName})
                 rollback.prependDefer(inst.debugreport_delete, reportName)
                 taskid = task['id']
-                self._wait_task(inst, taskid, 60)
+                self._wait_task(inst, taskid, timeout)
                 self.assertEquals('finished',
                                   inst.task_lookup(taskid)['status'],
                                   "It is not necessary an error.  "
-- 
1.8.1.4




More information about the Kimchi-devel mailing list