]> 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:56:52 +0000 (13:56 +0100)
committerCharles-François Natali <cf.natali@gmail.com>
Sun, 13 Jan 2013 12:56:52 +0000 (13:56 +0100)
could be the cause of a random failure).

Lib/test/test_asyncore.py

index 5f55df89f51cf802d9bcbae37a843ac55c8b3986..8989a632e812c27407ca544e322c78c383169648 100644 (file)
@@ -738,6 +738,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 range(20):
             s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)