Commit a0978648 authored by Marius Gedminas's avatar Marius Gedminas

Fix nondeterministic testmvcc failures

This test wants to rely on OIDs that are assigned to various objects.
OIDs are assigned by Pickler.persistent_id(), which gets called during
graph traversal in a nonspecific order (courtesy randomized hashes in
Python 3), so if we want to be sure to have the right OIDs assigned to
the right objects, we need to call connection.add() manually or commit
after adding every object.
parent 7c272467
......@@ -51,6 +51,7 @@ setup an initial database state.
>>> from ZODB.tests.MinPO import MinPO
>>> r = cn1.root()
>>> r["a"] = MinPO(1)
>>> tm1.get().commit() # make sure the OIDs get allocated sequentially
>>> r["b"] = MinPO(1)
>>> tm1.get().commit()
......@@ -340,6 +341,7 @@ non-current revision to load.
>>> cn1 = db.open(transaction_manager=tm1)
>>> r1 = cn1.root()
>>> r1["a"] = MinPO(0)
>>> tm1.get().commit() # make sure the OIDs get allocated sequentially
>>> r1["b"] = MinPO(0)
>>> tm1.get().commit()
>>> r1["b"].value = 1
......@@ -377,6 +379,7 @@ activate "b" will result in a ReadConflictError.
>>> cn1 = db.open(transaction_manager=tm1)
>>> r1 = cn1.root()
>>> r1["a"] = MinPO(0)
>>> tm1.get().commit() # make sure the OIDs get allocated sequentially
>>> r1["b"] = MinPO(0)
>>> tm1.get().commit()
>>> cn1.cacheMinimize() # makes everything in cache a ghost
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment