[Zope3-checkins] CVS: ZODB4/src/zodb/zeo/tests - commitlock.py:1.6 connection.py:1.8 test_tbuf.py:1.3 test_zeo.py:1.9 threadtests.py:1.6

Barry Warsaw barry@wooz.org
Thu, 13 Mar 2003 16:32:31 -0500


Update of /cvs-repository/ZODB4/src/zodb/zeo/tests
In directory cvs.zope.org:/tmp/cvs-serv27419/src/zodb/zeo/tests

Modified Files:
	commitlock.py connection.py test_tbuf.py test_zeo.py 
	threadtests.py 
Log Message:
> I believe we're ready to merge back to the head.

merging the opaque-pickles-branch back into the head



=== ZODB4/src/zodb/zeo/tests/commitlock.py 1.5 => 1.6 ===
--- ZODB4/src/zodb/zeo/tests/commitlock.py:1.5	Thu Mar 13 13:48:58 2003
+++ ZODB4/src/zodb/zeo/tests/commitlock.py	Thu Mar 13 16:32:30 2003
@@ -19,13 +19,13 @@
 from zodb.ztransaction import Transaction
 from zodb.timestamp import TimeStamp
 from zodb.storage.tests.base import zodb_pickle, MinPO
+from zodb.interfaces import ZERO
 
 from zodb.zeo.client import ClientStorage
 from zodb.zeo.interfaces import ClientDisconnected
 from zodb.zeo.tests.thread import TestThread
 from zodb.zeo.tests.common import DummyDB
 
-ZERO = '\0'*8
 
 class WorkerThread(TestThread):
 
@@ -43,11 +43,11 @@
         try:
             self.storage.tpcBegin(self.trans)
             oid = self.storage.newObjectId()
-            p = zodb_pickle(MinPO("c"))
-            self.storage.store(oid, ZERO, p, '', self.trans)
+            data, refs = zodb_pickle(MinPO("c"))
+            self.storage.store(oid, ZERO, data, refs, '', self.trans)
             oid = self.storage.newObjectId()
-            p = zodb_pickle(MinPO("c"))
-            self.storage.store(oid, ZERO, p, '', self.trans)
+            data, refs = zodb_pickle(MinPO("c"))
+            self.storage.store(oid, ZERO, data, refs, '', self.trans)
             self.myvote()
             if self.method == "tpcFinish":
                 self.storage.tpcFinish(self.trans)
@@ -98,7 +98,8 @@
         txn = Transaction()
         self._storage.tpcBegin(txn)
         oid = self._storage.newObjectId()
-        self._storage.store(oid, ZERO, zodb_pickle(MinPO(1)), '', txn)
+        data, refs = zodb_pickle(MinPO(1))
+        self._storage.store(oid, ZERO, data, refs, '', txn)
         return oid, txn
 
     def checkCommitLockVoteFinish(self):


=== ZODB4/src/zodb/zeo/tests/connection.py 1.7 => 1.8 ===
--- ZODB4/src/zodb/zeo/tests/connection.py:1.7	Thu Mar 13 13:48:58 2003
+++ ZODB4/src/zodb/zeo/tests/connection.py	Thu Mar 13 16:32:30 2003
@@ -284,8 +284,8 @@
         txn = Transaction()
         self._storage.tpcBegin(txn)
         for oid in oids:
-            data = zodb_pickle(MinPO(oid))
-            self._storage.store(oid, None, data, '', txn)
+            data, refs = zodb_pickle(MinPO(oid))
+            self._storage.store(oid, None, data, refs, '', txn)
         self.shutdownServer()
         self.assertRaises(ClientDisconnected, self._storage.tpcVote, txn)
         self._storage.tpcAbort(txn)
@@ -751,8 +751,8 @@
                     c.__oids.append(oid)
                     data = MinPO("%s.%s.t%d.o%d" % (tname, c.__name, i, j))
                     #print data.value
-                    data = zodb_pickle(data)
-                    s = c.store(oid, ZERO, data, '', t)
+                    data, refs = zodb_pickle(data)
+                    s = c.store(oid, ZERO, data, refs, '', t)
                     c.__serials.update(handle_all_serials(oid, s))
 
             # Vote on all servers and handle serials


=== ZODB4/src/zodb/zeo/tests/test_tbuf.py 1.2 => 1.3 ===
--- ZODB4/src/zodb/zeo/tests/test_tbuf.py:1.2	Wed Dec 25 09:12:22 2002
+++ ZODB4/src/zodb/zeo/tests/test_tbuf.py	Thu Mar 13 16:32:30 2003
@@ -23,7 +23,7 @@
 
 def new_store_data():
     """Return arbitrary data to use as argument to store() method."""
-    return random_string(8), '', random_string(random.randrange(1000))
+    return random_string(8), '', random_string(random.randrange(1000)), []
 
 def new_invalidate_data():
     """Return arbitrary data to use as argument to invalidate() method."""


=== ZODB4/src/zodb/zeo/tests/test_zeo.py 1.8 => 1.9 ===
--- ZODB4/src/zodb/zeo/tests/test_zeo.py:1.8	Tue Feb 25 13:55:05 2003
+++ ZODB4/src/zodb/zeo/tests/test_zeo.py	Thu Mar 13 16:32:30 2003
@@ -27,6 +27,7 @@
 import zodb
 from zodb.storage.tests.minpo import MinPO
 from zodb.storage.tests.base import zodb_unpickle
+from transaction import get_transaction
 
 
 # ZODB test mixin classes
@@ -84,11 +85,11 @@
 class StorageTests(
     # Base class for all ZODB tests
     base.StorageTestBase,
-    # ZODB test mixin classes 
+    # ZODB test mixin classes
     basic.BasicStorage,
     readonly.ReadOnlyStorage,
     synchronization.SynchronizedStorage,
-    # ZEO test mixin classes 
+    # ZEO test mixin classes
     commitlock.CommitLockTests,
     threadtests.ThreadTests,
     # Locally defined (see above)
@@ -106,6 +107,8 @@
         self._storage.registerDB(DummyDB())
 
     def tearDown(self):
+        # Clean up any transaction that might be left hanging around
+        get_transaction().abort()
         self._storage.close()
         for server in self._servers:
             forker.shutdown_zeo_server(server)
@@ -171,15 +174,15 @@
 
     # XXX These test seems to have massive failures when I run them.
     # I don't think they should fail, but need Barry's help to debug.
-    
+
     def checkCommitLockUndoClose(self):
         pass
-    
+
     def checkCommitLockUndoAbort(self):
         pass
 
 class MappingStorageTests(StorageTests):
-    
+
     def getConfig(self):
         self._envdir = tempfile.mktemp()
         return """\


=== ZODB4/src/zodb/zeo/tests/threadtests.py 1.5 => 1.6 ===
--- ZODB4/src/zodb/zeo/tests/threadtests.py:1.5	Tue Feb 25 13:55:05 2003
+++ ZODB4/src/zodb/zeo/tests/threadtests.py	Thu Mar 13 16:32:30 2003
@@ -50,7 +50,8 @@
     def run(self):
         self.storage.tpcBegin(self.trans)
         oid = self.storage.newObjectId()
-        self.storage.store(oid, ZERO, zodb_pickle(MinPO("c")), '', self.trans)
+        data, refs = zodb_pickle(MinPO("c"))
+        self.storage.store(oid, ZERO, data, refs, '', self.trans)
         self.storage.tpcVote(self.trans)
         self.threadStartedEvent.set()
         self.doNextEvent.wait(10)