[Zope3-checkins] CVS: Zope3/src/ZODB/tests - testmvcc.py:1.5
Jeremy Hylton
jeremy at zope.com
Fri Mar 12 00:10:09 EST 2004
Update of /cvs-repository/Zope3/src/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv22981
Modified Files:
testmvcc.py
Log Message:
Fix the invalidation-during-load test to execute the branch of interest.
=== Zope3/src/ZODB/tests/testmvcc.py 1.4 => 1.5 ===
--- Zope3/src/ZODB/tests/testmvcc.py:1.4 Thu Mar 11 22:12:55 2004
+++ Zope3/src/ZODB/tests/testmvcc.py Fri Mar 12 00:10:08 2004
@@ -256,7 +256,10 @@
... self.db.invalidate(tid, {oid:1})
... self.count += 1
-Now we'll repeat all the setup that was done earlier.
+We can execute this test with a single connection, because we're
+synthesizing the invalidation that is normally generated by the second
+connection. We need to create two revisions so that there is a
+non-current revision to load.
>>> ts = TestStorage()
>>> db = DB(ts)
@@ -266,6 +269,8 @@
>>> r1["a"] = MinPO(0)
>>> r1["b"] = MinPO(0)
>>> cn1.getTransaction().commit()
+>>> r1["b"].value = 1
+>>> cn1.getTransaction().commit()
>>> cn1.cacheMinimize()
>>> oid = r1["b"]._p_oid
@@ -280,18 +285,12 @@
>>> r1["b"]._p_state
-1
>>> r1["b"]._p_activate()
-Traceback (most recent call last):
- ...
-ReadConflictError: database read conflict error (oid 0000000000000002, class ZODB.tests.MinPO.MinPO)
>>> oid in cn1._invalidated
True
>>> ts.count
1
_p_independent() still has the desired effect.
-
-We still get a non-current version if the invalidation occurs while we
-are loading the current revision. Can that happen without ZEO?
Error cases:
- storage doesn't have an earlier revision
More information about the Zope3-Checkins
mailing list