[Zope-Checkins] CVS: Zope/lib/python/ZODB/tests - TransactionalUndoStorage.py:1.18.18.1 testCache.py:1.5.6.1

Matt Behrens matt@zigg.com
Wed, 29 May 2002 15:45:55 -0400


Update of /cvs-repository/Zope/lib/python/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv18366/lib/python/ZODB/tests

Modified Files:
      Tag: zigg_unix-install-control-config-branch
	TransactionalUndoStorage.py testCache.py 
Log Message:
Merge in HEAD (except setup.py... gotta chat about that one) :-)


=== Zope/lib/python/ZODB/tests/TransactionalUndoStorage.py 1.18 => 1.18.18.1 ===
 ZERO = '\0'*8
 
-
 class TransactionalUndoStorage:
 
     def _transaction_begin(self):
@@ -430,9 +429,14 @@
         # Add a few object revisions
         oid = self._storage.new_oid()
         revid1 = self._dostore(oid, data=MinPO(51))
-        # Save now for packing away revid1
-        packtime = time.time()
-        time.sleep(1)
+        # For the pack(), we need a timestamp greater than revid1's timestamp.
+        # The semantics of pack()'s `t' argument is that all non-current
+        # revisions with an earlier timestamp will be packed away.  If they
+        # were equal (because the Windows clock resolution is too coarse),
+        # then we won't pack away the first revision.
+        now = packtime = time.time()
+        while packtime <= now:
+            packtime = time.time()
         revid2 = self._dostore(oid, revid=revid1, data=MinPO(52))
         revid3 = self._dostore(oid, revid=revid2, data=MinPO(53))
         # Now get the undo log


=== Zope/lib/python/ZODB/tests/testCache.py 1.5 => 1.5.6.1 ===
             # not bother to check this
 
+
+    # checkSize and checkDetail are bad tests. They rely on 
+    # several different types of non-deterministic behavior
+    # in noodle_new_connection. Both tests pass most of the
+    # time, but do fail intermittantly.
+    # Toby Dickenson promised to improve this
     def checkSize(self):
         self.assertEqual(self.db.cacheSize(), 0)
         self.assertEqual(self.db.cacheDetailSize(), [])
@@ -180,6 +186,7 @@
             # the connection holds a reference to it
             self.assertEquals(d['size'], CACHE_SIZE + 1)
 
+    # checkDetail is a bad test. See checkSize for more details
     def checkDetail(self):
         CACHE_SIZE = 10
         self.db.setCacheSize(CACHE_SIZE)