Rev 5254: Threaded http server should use ThreadWithException for the client threads too. in file:///home/vila/src/bzr/experimental/leaking-tests/

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon May 31 13:51:10 BST 2010


At file:///home/vila/src/bzr/experimental/leaking-tests/

------------------------------------------------------------
revno: 5254
revision-id: v.ladeuil+lp at free.fr-20100531125110-gu1ip32jmf59s198
parent: v.ladeuil+lp at free.fr-20100529155356-1hn89tooo4jq2b1l
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: propagate-exceptions
timestamp: Mon 2010-05-31 14:51:10 +0200
message:
  Threaded http server should use ThreadWithException for the client threads too.
  
  * bzrlib/tests/http_server.py:
  (TestingThreadingHTTPServer.process_request): Use ThreadWithException.
-------------- next part --------------
=== modified file 'bzrlib/tests/http_server.py'
--- a/bzrlib/tests/http_server.py	2010-05-29 15:53:56 +0000
+++ b/bzrlib/tests/http_server.py	2010-05-31 12:51:10 +0000
@@ -532,9 +532,13 @@
         """Start a new thread to process the request."""
         client = self.clients.pop()
         started = threading.Event()
-        t = threading.Thread(target = self.process_request_thread,
-                             args = (started, request, client_address))
+        t = test_server.ThreadWithException(
+            event=started,
+            target = self.process_request_thread,
+            args = (started, request, client_address))
         t.name = '%s -> %s' % (client_address, self.server_address)
+        if 'threads' in tests.selftest_debug_flags:
+            print 'Thread for: %s started' % (threading.currentThread().name,)
         client.append(t)
         self.clients.append(client)
         if self.daemon_threads:



More information about the bazaar-commits mailing list