From c241df814f614e5e702d2517caf9c0e811a6ca1a Mon Sep 17 00:00:00 2001 From: Jesus Cea Date: Tue, 8 Nov 2011 16:20:46 +0100 Subject: [PATCH] Solved a potential deadlock in test_telnetlib.py. Related to issue #11812 --- Lib/test/test_telnetlib.py | 4 ---- Misc/NEWS | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py index a78b938b86f..0f0b2ac82d7 100644 --- a/Lib/test/test_telnetlib.py +++ b/Lib/test/test_telnetlib.py @@ -21,7 +21,6 @@ def server(evt, serv): conn.close() finally: serv.close() - evt.set() class GeneralTests(TestCase): @@ -33,11 +32,8 @@ class GeneralTests(TestCase): self.thread = threading.Thread(target=server, args=(self.evt,self.sock)) self.thread.start() self.evt.wait() - self.evt.clear() - time.sleep(.1) def tearDown(self): - self.evt.wait() self.thread.join() def testBasic(self): diff --git a/Misc/NEWS b/Misc/NEWS index 0d5f98116d8..5529786d802 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -527,6 +527,8 @@ Tests - Skip network tests when getaddrinfo() returns EAI_AGAIN, meaning a temporary failure in name resolution. +- Solved a potential deadlock in test_telnetlib.py. Related to issue #11812. + - Avoid failing in test_urllibnet.test_bad_address when some overzealous DNS service (e.g. OpenDNS) resolves a non-existent domain name. The test is now skipped instead.