From: Charles-François Natali Date: Sun, 13 Jan 2013 12:55:13 +0000 (+0100) Subject: test_asyncore: wait explicitly for a thread termination (this dangling thread X-Git-Tag: v2.7.4rc1~248 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c9047149b900f28211f1afeabff1858a9fbf8f9;p=thirdparty%2FPython%2Fcpython.git test_asyncore: wait explicitly for a thread termination (this dangling thread could be the cause of a random failure). --- diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py index 8f875ffb5f64..134470fb79a9 100644 --- a/Lib/test/test_asyncore.py +++ b/Lib/test/test_asyncore.py @@ -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)