[PATCH V1 0/2] Debugreport tool test enhancement

1)We need a way to tune the debugreport timeout value 2)Skip the test if there is not debugreport tool Shu Ming (2): Skip the debug report test if there is no tool avaible Add a timeout tunning environment variable for debug report test tests/test_model.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) -- 1.8.1.4

Skip the debug report test if there is no tool avaible Signed-off-by: Shu Ming <shuming@linux.vnet.ibm.com> --- tests/test_model.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_model.py b/tests/test_model.py index c689bcc..dad4670 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -610,6 +610,10 @@ class ModelTests(unittest.TestCase): def test_debug_reports(self): inst = kimchi.model.Model('test:///default', objstore_loc=self.tmp_store) + + if not inst.get_capabilities()['system_report_tool']: + raise unittest.SkipTest("Without debug report tool") + namePrefix = 'unitTestReport' # sosreport always deletes unsual letters like '-' and '_' in the # generated report file name. -- 1.8.1.4

Reviewed-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> On 01/09/2014 06:40 PM, Shu Ming wrote:
Skip the debug report test if there is no tool avaible
Signed-off-by: Shu Ming <shuming@linux.vnet.ibm.com> --- tests/test_model.py | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/tests/test_model.py b/tests/test_model.py index c689bcc..dad4670 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -610,6 +610,10 @@ class ModelTests(unittest.TestCase): def test_debug_reports(self): inst = kimchi.model.Model('test:///default', objstore_loc=self.tmp_store) + + if not inst.get_capabilities()['system_report_tool']: + raise unittest.SkipTest("Without debug report tool") + namePrefix = 'unitTestReport' # sosreport always deletes unsual letters like '-' and '_' in the # generated report file name.
-- Thanks and best regards! Sheldon Feng(冯少合)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center

It is helpful when the timeout happens and the tester can tune it Signed-off-by: Shu Ming <shuming@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

Just a minor comment below I have encounter this problems several times. not always happen. ====================================================================== FAIL: test_debug_reports (test_model.ModelTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/run/jenkins/workspace/kimchi_test/tests/test_model.py", line 639, in test_debug_reports raise e File "/run/jenkins/workspace/kimchi_test/tests/test_model.py", line 632, in test_debug_reports "It is not necessary an error. " AssertionError: It is not necessary an error. You may need to increase the timeout number in _wait_task() ---------------------------------------------------------------------- Ran 114 tests in 130.198s FAILED (failures=1) We need this patch. On 01/09/2014 06:40 PM, Shu Ming wrote:
It is helpful when the timeout happens and the tester can tune it you can give more information tell how to tune timeout
$ TEST_REPORT_TIMEOUT=120 ./run_tests.sh test_mode
Signed-off-by: Shu Ming <shuming@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. "
-- Thanks and best regards! Sheldon Feng(???)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center

on 2014/01/09 22:26, Sheldon wrote:
Just a minor comment below
I have encounter this problems several times. not always happen.
======================================================================
FAIL: test_debug_reports (test_model.ModelTests) ----------------------------------------------------------------------
Traceback (most recent call last): File "/run/jenkins/workspace/kimchi_test/tests/test_model.py", line 639, in test_debug_reports raise e File "/run/jenkins/workspace/kimchi_test/tests/test_model.py", line 632, in test_debug_reports "It is not necessary an error. " AssertionError: It is not necessary an error. You may need to increase the timeout number in _wait_task()
----------------------------------------------------------------------
Ran 114 tests in 130.198s
FAILED (failures=1)
We need this patch.
On 01/09/2014 06:40 PM, Shu Ming wrote:
It is helpful when the timeout happens and the tester can tune it you can give more information tell how to tune timeout
$ TEST_REPORT_TIMEOUT=120 ./run_tests.sh test_mode
Agree. You can update the timeout exception message bellow, and tell the user to set TEST_REPORT_TIMEOUT environment variable to a larger value.
Signed-off-by: Shu Ming <shuming@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. "
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
-- Thanks and best regards! Zhou Zheng Sheng / 周征晟 E-mail: zhshzhou@linux.vnet.ibm.com Telephone: 86-10-82454397
participants (3)
-
Sheldon
-
Shu Ming
-
Zhou Zheng Sheng