Skip to content

Commit c2870b6

Browse files
authored
bpo-33532: Fix multiprocessing test_ignore() (GH-7262) (#7266)
Fix test_ignore() of multiprocessing tests like test_multiprocessing_forkserver: use support.PIPE_MAX_SIZE to make sure that send_bytes() blocks. (cherry picked from commit 5d6c7ed)
1 parent 7da7a01 commit c2870b6

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
@@ -4029,7 +4029,7 @@ def handler(signum, frame):
40294029
conn.send('ready')
40304030
x = conn.recv()
40314031
conn.send(x)
4032-
conn.send_bytes(b'x'*(1024*1024)) # sending 1 MB should block
4032+
conn.send_bytes(b'x' * test.support.PIPE_MAX_SIZE)
40334033

40344034
@unittest.skipUnless(hasattr(signal, 'SIGUSR1'), 'requires SIGUSR1')
40354035
def test_ignore(self):
@@ -4048,7 +4048,8 @@ def test_ignore(self):
40484048
self.assertEqual(conn.recv(), 1234)
40494049
time.sleep(0.1)
40504050
os.kill(p.pid, signal.SIGUSR1)
4051-
self.assertEqual(conn.recv_bytes(), b'x'*(1024*1024))
4051+
self.assertEqual(conn.recv_bytes(),
4052+
b'x' * test.support.PIPE_MAX_SIZE)
40524053
time.sleep(0.1)
40534054
p.join()
40544055
finally:

0 commit comments

Comments
 (0)