[Zope3-checkins] CVS: Zope3/src/zodb/btrees/tests - test_conflict.py:1.8

Tim Peters tim.one@comcast.net
Sat, 11 Jan 2003 02:00:02 -0500


Update of /cvs-repository/Zope3/src/zodb/btrees/tests
In directory cvs.zope.org:/tmp/cvs-serv2338/src/zodb/btrees/tests

Modified Files:
	test_conflict.py 
Log Message:
testBucketSplitConflict():  Reenabled this.  Aborting the conflicting
transaction cleared up all the bad effects.  Still don't know which
ConflictError is intended to be caught, though.


=== Zope3/src/zodb/btrees/tests/test_conflict.py 1.7 => 1.8 ===
--- Zope3/src/zodb/btrees/tests/test_conflict.py:1.7	Sat Jan 11 01:35:06 2003
+++ Zope3/src/zodb/btrees/tests/test_conflict.py	Sat Jan 11 01:59:59 2003
@@ -443,27 +443,7 @@
         get_transaction().commit()  # if this doesn't blow up
         list(copy.values())         # and this doesn't either, then fine
 
-
-
-    # XXX This is named testXBucketSplitConflict because if it's named
-    # XXX testBucketSplitConflict it runs before testResolutionBlowsUp
-    # XXX above, and then the later dies like so:
-    # XXX
-    # XXX File "C:\Code\Zope3\src\zodb\btrees\tests\test_conflict.py", line 429, in testResolutionBlowsUp
-    # XXX     r1["t"] = self.t
-    # XXX File "C:\Code\Zope3\src\persistence\dict.py", line 57, in __setitem__
-    # XXX     self._p_changed = True
-    # XXX File "C:\Code\Zope3\src\zodb\connection.py", line 341, in register
-    # XXX     txn.join(self)
-    # XXX File "C:\Code\Zope3\src\transaction\txn.py", line 65, in join
-    # XXX     raise TransactionError("Can't join transaction. Status=%s" %
-    # XXX TransactionError: Can't join transaction. Status=Failed
-
-    # XXX Later:  lots of other tests die with "Can't join transaction"
-    # XXX errors too if testBucketSplitConflict is run.  Beats me -- perhaps
-    # XXX it's not cleaning something up that it should.
-    # def testBucketSplitConflict(self):
-    def disabled_testBucketSplitConflict(self):
+    def testBucketSplitConflict(self):
         # Tests that a bucket split is viewed as a conflict.
         # It's (almost necessarily) a white-box test, and sensitive to
         # implementation details.
@@ -541,6 +521,7 @@
         # XXX the ConflictError that gets raised here.
         from zodb.interfaces import ConflictError
         self.assertRaises(ConflictError, get_transaction().commit)
+        get_transaction().abort()   # horrible things happen w/o this
 
 
 def test_suite():