From 1d7637611ec0f5764d252211cd0ab28b4d1c0401 Mon Sep 17 00:00:00 2001 From: Alexander Maretskiy Date: Tue, 18 Oct 2016 14:18:15 +0300 Subject: [PATCH] [Tests] Fix functional test_time_hook Hook results order can differ depending on which hook has finished first, so functional test can fail sometimes. This is fixed by sorting results. Change-Id: Ie6dc1d85e6107dddaa464019b53465c287d0f345 --- tests/functional/test_cli_task.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/functional/test_cli_task.py b/tests/functional/test_cli_task.py index 25c04600..e8d9da49 100644 --- a/tests/functional/test_cli_task.py +++ b/tests/functional/test_cli_task.py @@ -1203,5 +1203,8 @@ class HookTestCase(unittest.TestCase): hooks_cfg = cfg["Dummy.dummy"][0]["hooks"] expected = [self._get_result(hooks_cfg[0], iterations=[5]), self._get_result(hooks_cfg[1], seconds=[3, 6, 9])] - self.assertEqual(expected, hook_results) + self.assertEqual( + expected, + sorted(hook_results, + key=lambda i: i["config"]["trigger"]["args"]["unit"])) self._assert_results_time(hook_results)