Commit 47db2515 authored by Tim Peters's avatar Tim Peters

checkFullSweep() and checkMinimize(): removed time.sleep(3) calls, and a comment block explaining

why the sleeps are needed.  The explanation (and the
sleeps) didn't make sense -- must be left over
from a cache implementation before my time.
parent b123baf5
...@@ -93,22 +93,14 @@ class DBMethods(CacheTestBase): ...@@ -93,22 +93,14 @@ class DBMethods(CacheTestBase):
# XXX not really sure how to do a black box test of the cache. # XXX not really sure how to do a black box test of the cache.
# should the full sweep and minimize calls always remove things? # should the full sweep and minimize calls always remove things?
# The sleep(3) call is based on the implementation of the cache.
# It's measures time in units of three seconds, so something used
# within the last three seconds looks like something that is
# currently being used. Three seconds old is the youngest
# something can be and still be collected.
def checkFullSweep(self): def checkFullSweep(self):
old_size = self.db.cacheSize() old_size = self.db.cacheSize()
time.sleep(3)
self.db.cacheFullSweep() self.db.cacheFullSweep()
new_size = self.db.cacheSize() new_size = self.db.cacheSize()
self.assert_(new_size < old_size, "%s < %s" % (old_size, new_size)) self.assert_(new_size < old_size, "%s < %s" % (old_size, new_size))
def checkMinimize(self): def checkMinimize(self):
old_size = self.db.cacheSize() old_size = self.db.cacheSize()
time.sleep(3)
self.db.cacheMinimize() self.db.cacheMinimize()
new_size = self.db.cacheSize() new_size = self.db.cacheSize()
self.assert_(new_size < old_size, "%s < %s" % (old_size, new_size)) self.assert_(new_size < old_size, "%s < %s" % (old_size, new_size))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment