[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/StandardCacheManagers/tests/test_AcceleratedHTTPCacheManager.py Fixed a test that would repeatedly cause hangs on this screaming dual G4 box.

Stefan H. Holek stefan at epy.co.at
Thu Apr 21 17:45:41 EDT 2005


Log message for revision 30089:
  Fixed a test that would repeatedly cause hangs on this screaming dual G4 box.
  

Changed:
  U   Zope/trunk/lib/python/Products/StandardCacheManagers/tests/test_AcceleratedHTTPCacheManager.py

-=-
Modified: Zope/trunk/lib/python/Products/StandardCacheManagers/tests/test_AcceleratedHTTPCacheManager.py
===================================================================
--- Zope/trunk/lib/python/Products/StandardCacheManagers/tests/test_AcceleratedHTTPCacheManager.py	2005-04-21 21:33:30 UTC (rev 30088)
+++ Zope/trunk/lib/python/Products/StandardCacheManagers/tests/test_AcceleratedHTTPCacheManager.py	2005-04-21 21:45:41 UTC (rev 30089)
@@ -17,6 +17,7 @@
 """
 import unittest
 import threading
+import time
 from SimpleHTTPServer import SimpleHTTPRequestHandler
 from BaseHTTPServer import HTTPServer
 
@@ -51,7 +52,7 @@
     def tearDown(self):
         if self.thread:
             self.httpd.server_close()
-            self.thread.join()
+            self.thread.join(2)
 
     def _getTargetClass(self):
 
@@ -73,7 +74,9 @@
 
         sa = self.httpd.socket.getsockname()
         self.thread = threading.Thread(target=self.httpd.handle_request)
+        self.thread.setDaemon(True)
         self.thread.start()
+        time.sleep(0.2) # Allow time for server startup
 
     def test_PURGE_passes_Host_header(self):
 



More information about the Zope-Checkins mailing list