diff --git a/GaudiPolicy/python/GaudiTesting/BaseTest.py b/GaudiPolicy/python/GaudiTesting/BaseTest.py index b61feda4483b990b41b1ee898b7d25b88e0af59c..49a42e8eb9232d58bc67e2c0e4d5fb68bb85c8d2 100644 --- a/GaudiPolicy/python/GaudiTesting/BaseTest.py +++ b/GaudiPolicy/python/GaudiTesting/BaseTest.py @@ -1485,6 +1485,11 @@ class JSONOutputValidator: # piggyback on TestCase dict diff report t = TestCase() + # sort both lists (these are list of entities) as the order is not supposed to matter + # indeed, the JSONSink implementation does not garantee any particular order + # but as JSON does not have sets, we get back a sorted list here + expected = sorted(expected, key=lambda item: (item["component"], item["name"])) + out = sorted(out, key=lambda item: (item["component"], item["name"])) try: t.assertEqual(expected, out) except AssertionError as err: