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 4ae16eb..878b26c 100644
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -789,7 +789,7 @@
             t = threading.Thread(target=lambda: asyncore.loop(timeout=0.1,
                                                               count=500))
             t.start()
-
+            self.addCleanup(t.join)
 
             s = socket.socket(self.family, socket.SOCK_STREAM)
             s.settimeout(.2)