diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-07-18 15:43:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-18 15:43:57 (GMT) |
commit | 99bb6df66a42625367c4f38e6802c8bb527baf4a (patch) | |
tree | 76f19551138a723629bf1a67c22311afe11df791 | |
parent | 5d4cb54800966947db2e86f65fb109c5067076be (diff) | |
download | cpython-99bb6df66a42625367c4f38e6802c8bb527baf4a.zip cpython-99bb6df66a42625367c4f38e6802c8bb527baf4a.tar.gz cpython-99bb6df66a42625367c4f38e6802c8bb527baf4a.tar.bz2 |
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.
-rw-r--r-- | Lib/test/test_signal.py | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index 354c3fd..e69db79 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()) |