[Zope-Checkins] CVS: Zope/lib/python/Products/Transience/tests - testTimeoutRelated.py:1.11.2.2 testTransientObjectContainer.py:1.14.2.3

Chris McDonough chrism at plope.com
Sun May 30 03:56:36 EDT 2004


Update of /cvs-repository/Zope/lib/python/Products/Transience/tests
In directory cvs.zope.org:/tmp/cvs-serv31944/tests

Modified Files:
      Tag: Zope-2_7-branch
	testTimeoutRelated.py testTransientObjectContainer.py 
Log Message:
- "Bucket finalization" is now done more aggressively.  Instead of waiting
  until a bucket is garbage collected (which may be much later than the
  expiration of that bucket), we "finalize" a bucket as soon as possible
  after it gets expired.  This effectively means that the "delete notifier"
  will be called much closer to the time that a transient object actually
  expires.
                                                                                
- Add a "_last_finalized_timeslice" counter; this counter keeps track of 
  the bucket which was finalized last.  Set the initial value of
  "_last_finalized_timeslice" to -period; this services the unit tests for
  finalization, where there can actually be a timeslice that is 0 and we 
   need to finalize that bucket.
                                                                                
- Add a series of locks to prevent finalization, replentishment, and
  garbage collection from being attempted by more than one thread
  simultaneously.
                                                                                
- Add "Fake" module for interactive testing purposes (swap out BTree for
  simpler object during stress tests for isolation purposes).
                                                                                
- Allow DATA_CLASS to be specified (this is the main data structure
  class).

- Update docs and tests to account for new finalization strategy.




=== Zope/lib/python/Products/Transience/tests/testTimeoutRelated.py 1.11.2.1 => 1.11.2.2 ===
--- Zope/lib/python/Products/Transience/tests/testTimeoutRelated.py:1.11.2.1	Fri May 14 18:52:13 2004
+++ Zope/lib/python/Products/Transience/tests/testTimeoutRelated.py	Sun May 30 03:56:35 2004
@@ -109,10 +109,9 @@
         self.app.sm.setDelNotificationTarget(delNotificationTarget)
         sdo = self.app.sm.new_or_existing('TempObject')
         timeout = self.timeout * 60
-        fauxtime.sleep(timeout + (timeout * .75))
+        # sleep 2X longer than timeout?  doesnt work at 1.1X, 1.5X?
+        fauxtime.sleep(timeout * 2) 
         sdo1 = self.app.sm.get('TempObject')
-        # force the sdm to do housekeeping
-        self.app.sm._gc()
         now = fauxtime.time()
         k = sdo.get('endtime')
         self.assertEqual(type(k), type(now))


=== Zope/lib/python/Products/Transience/tests/testTransientObjectContainer.py 1.14.2.2 => 1.14.2.3 ===
--- Zope/lib/python/Products/Transience/tests/testTransientObjectContainer.py:1.14.2.2	Sat May 22 23:51:57 2004
+++ Zope/lib/python/Products/Transience/tests/testTransientObjectContainer.py	Sun May 30 03:56:35 2004
@@ -249,7 +249,7 @@
         self.assertEqual(len(self.t.keys()), 100)
 
         # call _gc just to make sure __len__ gets changed after a gc
-        self.t._gc()
+        #self.t._gc()
         self.assertEqual(len(self.t), 100)
 
         # we should still have 100 - 199




More information about the Zope-Checkins mailing list