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

Zhou Zheng Sheng zhshzhou at linux.vnet.ibm.com
Wed Jan 15 08:42:55 UTC 2014


on 2014/01/15 16:37, Shu Ming wrote:
> 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 | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/test_model.py b/tests/test_model.py
> index 4a78fbc..1594b37 100644
> --- a/tests/test_model.py
> +++ b/tests/test_model.py
> @@ -640,6 +640,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.
> @@ -656,12 +661,14 @@ 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.  "
>                                    "You may need to increase the "
> -                                  "timeout number in _wait_task()")
> +                                  "timeout number by"
> +                                   "TEST_REPORT_TIMEOUT=200"
> +                                   "./run_tests.sh test_model")

Looks like a space is needed at the end of each "..." string, so that
Python join the long string correctly. I mean, "... by ", "...=200 ".

>                  report_list = inst.debugreports_get_list()
>                  self.assertTrue(reportName in report_list)
>              except OperationFailed, e:
> 


-- 
Thanks and best regards!

Zhou Zheng Sheng / 周征晟
E-mail: zhshzhou at linux.vnet.ibm.com
Telephone: 86-10-82454397




More information about the Kimchi-devel mailing list