Skip to content

Commit 252f6ab

Browse files
authored
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.
1 parent 829fcd0 commit 252f6ab

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Lib/test/_test_multiprocessing.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4330,6 +4330,9 @@ def test_closefd(self):
43304330

43314331
class TestIgnoreEINTR(unittest.TestCase):
43324332

4333+
# Sending CONN_MAX_SIZE bytes into a multiprocessing pipe must block
4334+
CONN_MAX_SIZE = max(support.PIPE_MAX_SIZE, support.SOCK_MAX_SIZE)
4335+
43334336
@classmethod
43344337
def _test_ignore(cls, conn):
43354338
def handler(signum, frame):
@@ -4338,7 +4341,7 @@ def handler(signum, frame):
43384341
conn.send('ready')
43394342
x = conn.recv()
43404343
conn.send(x)
4341-
conn.send_bytes(b'x' * support.PIPE_MAX_SIZE)
4344+
conn.send_bytes(b'x' * cls.CONN_MAX_SIZE)
43424345

43434346
@unittest.skipUnless(hasattr(signal, 'SIGUSR1'), 'requires SIGUSR1')
43444347
def test_ignore(self):
@@ -4357,7 +4360,7 @@ def test_ignore(self):
43574360
self.assertEqual(conn.recv(), 1234)
43584361
time.sleep(0.1)
43594362
os.kill(p.pid, signal.SIGUSR1)
4360-
self.assertEqual(conn.recv_bytes(), b'x' * support.PIPE_MAX_SIZE)
4363+
self.assertEqual(conn.recv_bytes(), b'x' * self.CONN_MAX_SIZE)
43614364
time.sleep(0.1)
43624365
p.join()
43634366
finally:

0 commit comments

Comments
 (0)