]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-33532: Fix multiprocessing test_ignore() (#7262)
authorVictor Stinner <vstinner@redhat.com>
Thu, 31 May 2018 03:08:42 +0000 (05:08 +0200)
committerGitHub <noreply@github.com>
Thu, 31 May 2018 03:08:42 +0000 (05:08 +0200)
Fix test_ignore() of multiprocessing tests like
test_multiprocessing_forkserver: use support.PIPE_MAX_SIZE to make
sure that send_bytes() blocks.

Lib/test/_test_multiprocessing.py

index 8b6bc4b23a02677d768d9985b108fa5268bb001e..2e24e9bc156507bd7151ebefef5524fc7945428d 100644 (file)
@@ -4338,7 +4338,7 @@ class TestIgnoreEINTR(unittest.TestCase):
         conn.send('ready')
         x = conn.recv()
         conn.send(x)
-        conn.send_bytes(b'x' * (1024 * 1024))   # sending 1 MiB should block
+        conn.send_bytes(b'x' * support.PIPE_MAX_SIZE)
 
     @unittest.skipUnless(hasattr(signal, 'SIGUSR1'), 'requires SIGUSR1')
     def test_ignore(self):
@@ -4357,7 +4357,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'*(1024*1024))
+            self.assertEqual(conn.recv_bytes(), b'x' * support.PIPE_MAX_SIZE)
             time.sleep(0.1)
             p.join()
         finally: