test_asyncore: wait explicitly for a thread termination (this dangling thread

could be the cause of a random failure).
This commit is contained in:
Charles-François Natali 2013-01-13 13:55:13 +01:00
parent 40056de9f5
commit 8c9047149b

View file

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