diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-06-01 14:48:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-01 14:48:34 (GMT) |
commit | 252f6abe0a9430f4ae7588c0cb50a6ff141bebe3 (patch) | |
tree | 9bde0dcf3f2b13a9f7f0b62adaae363bcd4a1ee2 /Lib/test/_test_multiprocessing.py | |
parent | 829fcd0612049b21a6d3802b3306705218255f6b (diff) | |
download | cpython-252f6abe0a9430f4ae7588c0cb50a6ff141bebe3.zip cpython-252f6abe0a9430f4ae7588c0cb50a6ff141bebe3.tar.gz cpython-252f6abe0a9430f4ae7588c0cb50a6ff141bebe3.tar.bz2 |
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.
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r-- | Lib/test/_test_multiprocessing.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 2e24e9b..31eadd2 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -4330,6 +4330,9 @@ class TestCloseFds(unittest.TestCase): 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): @@ -4338,7 +4341,7 @@ class TestIgnoreEINTR(unittest.TestCase): 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): @@ -4357,7 +4360,7 @@ class TestIgnoreEINTR(unittest.TestCase): 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: |