From: Victor Stinner Date: Wed, 18 Jul 2018 15:43:57 +0000 (+0200) Subject: bpo-34130: Fix test_signal.test_socket() (GH-8326) X-Git-Tag: v3.8.0a1~1361 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=99bb6df66a42625367c4f38e6802c8bb527baf4a;p=thirdparty%2FPython%2Fcpython.git bpo-34130: Fix test_signal.test_socket() (GH-8326) test_signal.test_socket(): On Windows, sometimes even if the C signal handler succeed to write the signal number into the write end of the socketpair, the test fails with a BlockingIOError on the non-blocking read.recv(1) because the read end of the socketpair didn't receive the byte yet. Fix the race condition on Windows by setting the read end as blocking. --- diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index 354c3fde168c..e69db79909cc 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -392,7 +392,6 @@ class WakeupSocketSignalTests(unittest.TestCase): signal.signal(signum, handler) read, write = socket.socketpair() - read.setblocking(False) write.setblocking(False) signal.set_wakeup_fd(write.fileno())