diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2016-05-02 11:23:00 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2016-05-03 14:00:20 -0700 |
commit | a833141144e9e1c9d9033eaf4125360ff5c18478 (patch) | |
tree | 5a71cdb1a514ee6ca74c1878d6d57fd92eb5b57c /framework/profile.py | |
parent | 6adfb9f592e0fb4733b5c0e566e9bf682183e2a3 (diff) |
framework/profile: Make test run order deterministic
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 <dylanx.c.baker@intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
Tested-by: Gabriel Feceoru <gabriel.feceoru@intel.com>
Diffstat (limited to 'framework/profile.py')
-rw-r--r-- | framework/profile.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/framework/profile.py b/framework/profile.py index 4940b1160..9a117a28b 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. |