diff options
| author | Victor Stinner <vstinner@redhat.com> | 2018-05-31 07:35:03 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-31 07:35:03 +0200 | 
| commit | c2870b699eb899f358b843c2d706ce8ca89b2bf4 (patch) | |
| tree | cef7559517926d333b6cb0a9f2ed8fe47ae63995 | |
| parent | 7da7a01f9949f625f29960883b001af44d54402a (diff) | |
| download | cpython-git-c2870b699eb899f358b843c2d706ce8ca89b2bf4.tar.gz | |
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 5d6c7ed5e340b2311a15f34e968d4bef09c71922)
| -rw-r--r-- | Lib/test/_test_multiprocessing.py | 5 | 
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index dd0a9d7a86..d7eb69bb8b 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -4029,7 +4029,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): @@ -4048,7 +4048,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:  | 
