mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
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 252f6abe0a
)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
This commit is contained in:
parent
29ae9dc7c3
commit
63fa8db58c
1 changed files with 5 additions and 2 deletions
|
@ -4295,6 +4295,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):
|
||||
|
@ -4303,7 +4306,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):
|
||||
|
@ -4322,7 +4325,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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue