[Zope3-checkins] CVS: Zope/lib/python/ZODB/tests - testCache.py:1.13.10.3

Tim Peters tim.one at comcast.net
Mon May 10 12:07:27 EDT 2004


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

Modified Files:
      Tag: Zope-2_7-branch
	testCache.py 
Log Message:
Backport fix for collector #1309:  The reference counts reported by
DB.cacheExtremeDetails() for ghosts were one too small.


=== Zope/lib/python/ZODB/tests/testCache.py 1.13.10.2 => 1.13.10.3 ===
--- Zope/lib/python/ZODB/tests/testCache.py:1.13.10.2	Mon Sep 15 17:26:57 2003
+++ Zope/lib/python/ZODB/tests/testCache.py	Mon May 10 12:07:26 2004
@@ -203,12 +203,15 @@
                 self.assertEqual(count, CONNS)
 
         for details in self.db.cacheExtremeDetail():
-            # one dict per object.  keys:
+            # one 'details' dict per object
             if details['klass'].endswith('PersistentMapping'):
                 self.assertEqual(details['state'], None)
             else:
                 self.assert_(details['klass'].endswith('MinPO'))
                 self.assertEqual(details['state'], 0)
+            # The cache should never hold an unreferenced ghost.
+            if details['state'] is None:    # i.e., it's a ghost
+                self.assert_(details['rc'] > 0)
 
 class StubDataManager:
     def setklassstate(self, object):




More information about the Zope3-Checkins mailing list