[Zope3-checkins] CVS: Zope3/src/zope/app/process/tests - test_bootstrap.py:1.5

Tim Peters tim.one at comcast.net
Mon Sep 22 10:55:00 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/process/tests
In directory cvs.zope.org:/tmp/cvs-serv21875/src/zope/app/process/tests

Modified Files:
	test_bootstrap.py 
Log Message:
TestBootstrapSubscriberBase:  added a tearDown method to close the
database and storage.  Because MemoryFullStorage is a flavor of
Berkeley storage, not closing the storage leaves behind immortal
daemon threads.  These aren't harmless, because under Python 2.3, they
try to execute during Python shutdown (long story), leading to bizarre
information-free "Exception in thread:" messages on stderr after the
test suite finishes.  All such messages I've seen so far were due to
these leftover threads, and no longer occur.

Four instances of immortal QueueProcessorThread threads are still left
behind, one by each of the four tests in

    zope.app.mail.tests.test_directives.DirectivesTest

Those aren't related to the Berkeley threads, and wake up only once
per 3 seconds (the Berkeley threads left behind woke up 20 times per
second).  So they're unlikely to wake up during Python shutdown, but are
certain to sooner or later.  So we may still see some sporadic nonsense
messages after the test suite finishes, and, if so, these
QueueProcessorThreads will almost certainly be the cause.


=== Zope3/src/zope/app/process/tests/test_bootstrap.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/process/tests/test_bootstrap.py:1.4	Sun Sep 21 13:32:35 2003
+++ Zope3/src/zope/app/process/tests/test_bootstrap.py	Mon Sep 22 10:54:59 2003
@@ -50,6 +50,10 @@
         self.storage = MemoryFullStorage("Memory Storage")
         self.db = DB(self.storage)
 
+    def tearDown(self):
+        self.db.close()
+        self.storage.close()
+
     def createRootFolder(self):
         cx = self.db.open()
         root = cx.root()




More information about the Zope3-Checkins mailing list