]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-33532: Fix multiprocessing test_ignore() (GH-7265)
authorVictor Stinner <vstinner@redhat.com>
Thu, 31 May 2018 05:35:34 +0000 (07:35 +0200)
committerGitHub <noreply@github.com>
Thu, 31 May 2018 05:35:34 +0000 (07:35 +0200)
Fix test_multiprocessing.test_ignore(): use support.PIPE_MAX_SIZE
to make sure that send_bytes() blocks.

Lib/test/test_multiprocessing.py

index 1071d7fac6532b5cca338aef81e2ddc16c52249f..b293e2fbc4ea9afa5bbbf600002604e8413e6d11 100644 (file)
@@ -2689,7 +2689,7 @@ class TestIgnoreEINTR(unittest.TestCase):
         conn.send('ready')
         x = conn.recv()
         conn.send(x)
-        conn.send_bytes(b'x'*(1024*1024))   # sending 1 MB should block
+        conn.send_bytes(b'x' * test_support.PIPE_MAX_SIZE)
 
     @unittest.skipUnless(hasattr(signal, 'SIGUSR1'), 'requires SIGUSR1')
     def test_ignore(self):
@@ -2708,7 +2708,8 @@ 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' * test_support.PIPE_MAX_SIZE)
             time.sleep(0.1)
             p.join()
         finally: