diff --git a/artiq/test/test_scheduler.py b/artiq/test/test_scheduler.py index 854f17a939..6a5f980613 100644 --- a/artiq/test/test_scheduler.py +++ b/artiq/test/test_scheduler.py @@ -199,18 +199,30 @@ def test_pending_priority(self): "value": "prepare_done", "key": "status" }, - { + [{ "path": [0], "action": "setitem", "value": "running", "key": "status" - }, - { + }, + { "path": [2], "action": "setitem", "value": "preparing", "key": "status" - }, + }], + [{ + "path": [0], + "action": "setitem", + "value": "running", + "key": "status" + }, + { + "path": [2], + "action": "setitem", + "value": "preparing", + "key": "status" + }], { "path": [2], "action": "setitem", @@ -235,18 +247,30 @@ def test_pending_priority(self): "value": "run_done", "key": "status" }, - { + [{ "path": [0], "action": "setitem", "value": "running", "key": "status" - }, - { + }, + { "path": [2], "action": "setitem", "value": "analyzing", "key": "status" - }, + }], + [{ + "path": [0], + "action": "setitem", + "value": "running", + "key": "status" + }, + { + "path": [2], + "action": "setitem", + "value": "analyzing", + "key": "status" + }], { "path": [2], "action": "setitem", @@ -259,11 +283,19 @@ def test_pending_priority(self): "key": 2 }, ] + mixable_case = [5, 6, 11, 12] done = asyncio.Event() expect_idx = 0 + def notify(mod): nonlocal expect_idx - self.assertEqual(mod, expect[expect_idx]) + if expect_idx in mixable_case: + if mod == expect[expect_idx][0]: + self.assertEqual(mod, expect[expect_idx][0]) + else: + self.assertEqual(mod, expect[expect_idx][1]) + else: + self.assertEqual(mod, expect[expect_idx]) expect_idx += 1 if expect_idx >= len(expect): done.set()