]> granicus.if.org Git - python/commitdiff
test_asyncore: wait explicitly for a thread termination (this dangling thread
authorCharles-François Natali <cf.natali@gmail.com>
Sun, 13 Jan 2013 12:55:13 +0000 (13:55 +0100)
committerCharles-François Natali <cf.natali@gmail.com>
Sun, 13 Jan 2013 12:55:13 +0000 (13:55 +0100)
could be the cause of a random failure).

Lib/test/test_asyncore.py

index 8f875ffb5f6415aba41eca2d081f2ffed8f7e2f4..134470fb79a9eab9757974a7570959221f8b4deb 100644 (file)
@@ -712,6 +712,7 @@ class BaseTestAPI(unittest.TestCase):
         server = TCPServer()
         t = threading.Thread(target=lambda: asyncore.loop(timeout=0.1, count=500))
         t.start()
+        self.addCleanup(t.join)
 
         for x in xrange(20):
             s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)