Skip to content

Commit 5d6c7ed

Browse files
authored
bpo-33532: Fix multiprocessing test_ignore() (#7262)
Fix test_ignore() of multiprocessing tests like test_multiprocessing_forkserver: use support.PIPE_MAX_SIZE to make sure that send_bytes() blocks.
1 parent 02e2a08 commit 5d6c7ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/_test_multiprocessing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4338,7 +4338,7 @@ def handler(signum, frame):
43384338
conn.send('ready')
43394339
x = conn.recv()
43404340
conn.send(x)
4341-
conn.send_bytes(b'x' * (1024 * 1024)) # sending 1 MiB should block
4341+
conn.send_bytes(b'x' * support.PIPE_MAX_SIZE)
43424342

43434343
@unittest.skipUnless(hasattr(signal, 'SIGUSR1'), 'requires SIGUSR1')
43444344
def test_ignore(self):
@@ -4357,7 +4357,7 @@ def test_ignore(self):
43574357
self.assertEqual(conn.recv(), 1234)
43584358
time.sleep(0.1)
43594359
os.kill(p.pid, signal.SIGUSR1)
4360-
self.assertEqual(conn.recv_bytes(), b'x'*(1024*1024))
4360+
self.assertEqual(conn.recv_bytes(), b'x' * support.PIPE_MAX_SIZE)
43614361
time.sleep(0.1)
43624362
p.join()
43634363
finally:

0 commit comments

Comments
 (0)