Test run order has been non-deterministic because of the data structure used, a dict. This patch simple replaces the dict with an OrderedDict, which is just like a dict, except that it remembers insertion order. This means that when using -1/--no-concurrency option that tests will be run in a deterministic order.
What this does not change, however, is the sorting of the tests in the on disk JSON file, those remain unsorted. Signed-off-by: Dylan Baker <[email protected]> --- framework/profile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/framework/profile.py b/framework/profile.py index 4940b11..9a117a2 100644 --- a/framework/profile.py +++ b/framework/profile.py @@ -63,13 +63,14 @@ class TestDict(collections.MutableMapping): def __init__(self): # This is because it had special __setitem__ and __getitem__ protocol # methods, and simply passing *args and **kwargs into self.__container - # will bypass these methods + # will bypass these methods. It will also break the ordering, since a + # regular dictionary or keyword arguments are inherintly unordered # # This counter is incremented once when the allow_reassignment context # manager is opened, and decremented each time it is closed. This # allows stacking of the context manager self.__allow_reassignment = 0 - self.__container = dict() + self.__container = collections.OrderedDict() def __setitem__(self, key, value): """Enforce types on set operations. -- 2.8.2 _______________________________________________ Piglit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/piglit
