From a3e5ad49cb6ae5b667c5560ddfc32a3abba686ba Mon Sep 17 00:00:00 2001 From: Boris Pavlovic Date: Sun, 30 Jul 2017 15:07:27 -0700 Subject: [PATCH] Reduce 2 minutes of sleeps in functional cli task trends test Dummy.dummy_random_action was sleeping between 0-2 seconds and sleep was called 4 * 5 times which produce ~20-40 extra seconds of sleeps Change-Id: Iad3b119be372adceb9730fa518a83b25ca9f0633 --- tests/functional/test_cli_task.py | 43 ++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/tests/functional/test_cli_task.py b/tests/functional/test_cli_task.py index 587192f9..3694b2b0 100644 --- a/tests/functional/test_cli_task.py +++ b/tests/functional/test_cli_task.py @@ -362,18 +362,43 @@ class TaskTestCase(unittest.TestCase): def test_trends(self): cfg1 = { "Dummy.dummy": [ - {"runner": {"type": "constant", "times": 2, - "concurrency": 2}}], + { + "runner": { + "type": "constant", + "times": 2, + "concurrency": 2 + } + } + ], "Dummy.dummy_random_action": [ - {"args": {"actions_num": 4}, - "runner": {"type": "constant", "times": 2, "concurrency": 2}}, - {"runner": {"type": "constant", "times": 2, - "concurrency": 2}}]} + { + "args": {"actions_num": 4}, + "runner": { + "type": "constant", + "times": 2, + "concurrency": 2 + } + }, + { + "runner": { + "type": "constant", + "times": 2, + "concurrency": 2 + } + } + ] + } cfg2 = { "Dummy.dummy": [ - {"args": {"sleep": 0.6}, - "runner": {"type": "constant", "times": 2, - "concurrency": 2}}]} + { + "args": {"sleep": 0.2}, + "runner": { + "type": "constant", "times": 2, + "concurrency": 2 + } + } + ] + } config1 = utils.TaskConfig(cfg1) config2 = utils.TaskConfig(cfg2)