[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
This commit is contained in:
parent
16e29e1368
commit
1d7637611e
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user