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

could be the cause of a random failure).
parent 74fe9f30
...@@ -738,6 +738,7 @@ class BaseTestAPI(unittest.TestCase): ...@@ -738,6 +738,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 range(20): for x in range(20):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment