]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #19919: Fix flacky SSL test. connect_ex() sometimes returns
authorChristian Heimes <christian@cheimes.de>
Mon, 16 Dec 2013 20:15:44 +0000 (21:15 +0100)
committerChristian Heimes <christian@cheimes.de>
Mon, 16 Dec 2013 20:15:44 +0000 (21:15 +0100)
EWOULDBLOCK on Windows or VMs hosted on Windows.

Lib/test/test_ssl.py
Misc/NEWS

index 06d4598a87790bcad90b93ffa3977aec5ca5ad1c..f235daf4635af6e08c7ec71ff64c2776108628c7 100644 (file)
@@ -835,8 +835,10 @@ class NetworkedTests(unittest.TestCase):
                                 cert_reqs=ssl.CERT_REQUIRED,
                                 ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
             try:
-                self.assertEqual(errno.ECONNREFUSED,
-                                 s.connect_ex(("svn.python.org", 444)))
+                rc = s.connect_ex(("svn.python.org", 444))
+                # Issue #19919: Windows machines or VMs hosted on Windows
+                # machines sometimes return EWOULDBLOCK.
+                self.assertIn(rc, (errno.ECONNREFUSED, errno.EWOULDBLOCK))
             finally:
                 s.close()
 
index cacfb7c6b7b5a8e3e69ce470dabe9339ee79a023..7c0232d9b8223d61f6df48c1892ef44b68a63a97 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -149,6 +149,9 @@ IDLE
 Tests
 -----
 
+- Issue #19919: Fix flacky SSL test. connect_ex() sometimes returns
+  EWOULDBLOCK on Windows or VMs hosted on Windows.
+
 - Issue #19912: Added tests for ntpath.splitunc().
 
 - Issue #19828: Fixed test_site when the whole suite is run with -S.