From 6e82751e2ecdb6178cf294253fd8db867b81f5f6 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 18 Jul 2018 16:20:57 +0200 Subject: [PATCH] bpo-34130: Fix test_signal.test_socket() Sometimes on Windows, test_signal.test_socket() fails on recv(1) with BlockingIOError. The C signal handler wrote the signal number using send() which returns 1 byte as expected, but the read end of the socket pair doesn't get "immediately" the byte. Configure the read end of the socket pair as blocking to wait until we get the signal number and so fix the race condition on Windows. --- Lib/test/test_signal.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index 354c3fde168c32..e69db79909cc97 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -392,7 +392,6 @@ def handler(signum, frame): signal.signal(signum, handler) read, write = socket.socketpair() - read.setblocking(False) write.setblocking(False) signal.set_wakeup_fd(write.fileno())