mirror of
https://github.com/python/cpython.git
synced 2025-12-04 16:43:27 +00:00
Issue #17835: Fix test_io when the default OS pipe buffer size is larger than one million bytes.
This commit is contained in:
commit
34373b2252
3 changed files with 11 additions and 6 deletions
|
|
@ -575,10 +575,12 @@ def _is_ipv6_enabled():
|
||||||
IPV6_ENABLED = _is_ipv6_enabled()
|
IPV6_ENABLED = _is_ipv6_enabled()
|
||||||
|
|
||||||
|
|
||||||
# A constant likely larger than the underlying OS pipe buffer size.
|
# A constant likely larger than the underlying OS pipe buffer size, to
|
||||||
# Windows limit seems to be around 512B, and many Unix kernels have a 64K pipe
|
# make writes blocking.
|
||||||
# buffer size or 16*PAGE_SIZE: take a few megs to be sure. This
|
# Windows limit seems to be around 512 B, and many Unix kernels have a
|
||||||
PIPE_MAX_SIZE = 3 * 1000 * 1000
|
# 64 KiB pipe buffer size or 16 * PAGE_SIZE: take a few megs to be sure.
|
||||||
|
# (see issue #17835 for a discussion of this number).
|
||||||
|
PIPE_MAX_SIZE = 4 *1024 * 1024 + 1
|
||||||
|
|
||||||
|
|
||||||
# decorator for skipping tests on non-IEEE 754 platforms
|
# decorator for skipping tests on non-IEEE 754 platforms
|
||||||
|
|
|
||||||
|
|
@ -3069,7 +3069,7 @@ class SignalsTest(unittest.TestCase):
|
||||||
# The buffered IO layer must check for pending signal
|
# The buffered IO layer must check for pending signal
|
||||||
# handlers, which in this case will invoke alarm_interrupt().
|
# handlers, which in this case will invoke alarm_interrupt().
|
||||||
self.assertRaises(ZeroDivisionError,
|
self.assertRaises(ZeroDivisionError,
|
||||||
wio.write, item * (support.PIPE_MAX_SIZE // len(item)))
|
wio.write, item * (support.PIPE_MAX_SIZE // len(item) + 1))
|
||||||
t.join()
|
t.join()
|
||||||
# We got one byte, get another one and check that it isn't a
|
# We got one byte, get another one and check that it isn't a
|
||||||
# repeat of the first one.
|
# repeat of the first one.
|
||||||
|
|
@ -3168,7 +3168,7 @@ class SignalsTest(unittest.TestCase):
|
||||||
select = support.import_module("select")
|
select = support.import_module("select")
|
||||||
# A quantity that exceeds the buffer size of an anonymous pipe's
|
# A quantity that exceeds the buffer size of an anonymous pipe's
|
||||||
# write end.
|
# write end.
|
||||||
N = 1024 * 1024
|
N = support.PIPE_MAX_SIZE
|
||||||
r, w = os.pipe()
|
r, w = os.pipe()
|
||||||
fdopen_kwargs["closefd"] = False
|
fdopen_kwargs["closefd"] = False
|
||||||
# We need a separate thread to read from the pipe and allow the
|
# We need a separate thread to read from the pipe and allow the
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,9 @@ Library
|
||||||
Tests
|
Tests
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
- Issue #17835: Fix test_io when the default OS pipe buffer size is larger
|
||||||
|
than one million bytes.
|
||||||
|
|
||||||
- Issue #17065: Use process-unique key for winreg tests to avoid failures if
|
- Issue #17065: Use process-unique key for winreg tests to avoid failures if
|
||||||
test is run multiple times in parallel (eg: on a buildbot host).
|
test is run multiple times in parallel (eg: on a buildbot host).
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue