Skip to content

Commit 82c456f

Browse files
authored
bpo-33532: Fix multiprocessing test_ignore() (GH-7265)
Fix test_multiprocessing.test_ignore(): use support.PIPE_MAX_SIZE to make sure that send_bytes() blocks.
1 parent d5e7556 commit 82c456f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/test/test_multiprocessing.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2689,7 +2689,7 @@ def handler(signum, frame):
26892689
conn.send('ready')
26902690
x = conn.recv()
26912691
conn.send(x)
2692-
conn.send_bytes(b'x'*(1024*1024)) # sending 1 MB should block
2692+
conn.send_bytes(b'x' * test_support.PIPE_MAX_SIZE)
26932693

26942694
@unittest.skipUnless(hasattr(signal, 'SIGUSR1'), 'requires SIGUSR1')
26952695
def test_ignore(self):
@@ -2708,7 +2708,8 @@ def test_ignore(self):
27082708
self.assertEqual(conn.recv(), 1234)
27092709
time.sleep(0.1)
27102710
os.kill(p.pid, signal.SIGUSR1)
2711-
self.assertEqual(conn.recv_bytes(), b'x'*(1024*1024))
2711+
self.assertEqual(conn.recv_bytes(),
2712+
b'x' * test_support.PIPE_MAX_SIZE)
27122713
time.sleep(0.1)
27132714
p.join()
27142715
finally:

0 commit comments

Comments
 (0)