[Zope-Checkins] CVS: ZODB3/ZEO/tests - CommitLockTests.py:1.9.10.1

Jeremy Hylton jeremy@zope.com
Wed, 13 Nov 2002 15:52:04 -0500


Update of /cvs-repository/ZODB3/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv4868

Modified Files:
      Tag: ZODB3-3_1-branch
	CommitLockTests.py 
Log Message:
Ensure that the first thread gets the lock.
Move tpc_vote() to before the other threads start.  


=== ZODB3/ZEO/tests/CommitLockTests.py 1.9 => 1.9.10.1 ===
--- ZODB3/ZEO/tests/CommitLockTests.py:1.9	Tue Sep 10 17:22:11 2002
+++ ZODB3/ZEO/tests/CommitLockTests.py	Wed Nov 13 15:52:04 2002
@@ -124,9 +124,12 @@
         # started, but before it finishes.  The dowork() function
         # executes after the first transaction has completed.
 
-        # Start on transaction normally.
+        # Start on transaction normally and get the lock.
         t = Transaction()
         self._storage.tpc_begin(t)
+        oid = self._storage.new_oid()
+        self._storage.store(oid, ZERO, zodb_pickle(MinPO(1)), '', t)
+        self._storage.tpc_vote(t)
 
         # Start a second transaction on a different connection without
         # blocking the test thread.
@@ -141,9 +144,6 @@
             else:
                 self._storages.append((storage2, t2))
 
-        oid = self._storage.new_oid()
-        self._storage.store(oid, ZERO, zodb_pickle(MinPO(1)), '', t)
-        self._storage.tpc_vote(t)
         if method_name == "tpc_finish":
             self._storage.tpc_finish(t)
             self._storage.load(oid, '')