[Python-checkins] bpo-33532: Fix test_multiprocessing_forkserver.test_ignore() (GH-7319)
Miss Islington (bot)
webhook-mailer at python.org
Fri Jun 1 11:21:26 EDT 2018
https://github.com/python/cpython/commit/63fa8db58c349f985d75139e6545cfddf067c07b
commit: 63fa8db58c349f985d75139e6545cfddf067c07b
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-06-01T08:21:21-07:00
summary:
bpo-33532: Fix test_multiprocessing_forkserver.test_ignore() (GH-7319)
Use also support.SOCK_MAX_SIZE, not only support.PIPE_MAX_SIZE, to
get the size for a blocking send into a multiprocessing pipe.
(cherry picked from commit 252f6abe0a9430f4ae7588c0cb50a6ff141bebe3)
Co-authored-by: Victor Stinner <vstinner at redhat.com>
files:
M Lib/test/_test_multiprocessing.py
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index f29dda70029b..4ae5f976a6b5 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -4295,6 +4295,9 @@ def test_closefd(self):
class TestIgnoreEINTR(unittest.TestCase):
+ # Sending CONN_MAX_SIZE bytes into a multiprocessing pipe must block
+ CONN_MAX_SIZE = max(support.PIPE_MAX_SIZE, support.SOCK_MAX_SIZE)
+
@classmethod
def _test_ignore(cls, conn):
def handler(signum, frame):
@@ -4303,7 +4306,7 @@ def handler(signum, frame):
conn.send('ready')
x = conn.recv()
conn.send(x)
- conn.send_bytes(b'x' * support.PIPE_MAX_SIZE)
+ conn.send_bytes(b'x' * cls.CONN_MAX_SIZE)
@unittest.skipUnless(hasattr(signal, 'SIGUSR1'), 'requires SIGUSR1')
def test_ignore(self):
@@ -4322,7 +4325,7 @@ def test_ignore(self):
self.assertEqual(conn.recv(), 1234)
time.sleep(0.1)
os.kill(p.pid, signal.SIGUSR1)
- self.assertEqual(conn.recv_bytes(), b'x' * support.PIPE_MAX_SIZE)
+ self.assertEqual(conn.recv_bytes(), b'x' * self.CONN_MAX_SIZE)
time.sleep(0.1)
p.join()
finally:
More information about the Python-checkins
mailing list