-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-95672 skip fcntl when pipesize is smaller than pagesize #102163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
a3e90fc
89cc89f
81a7ac4
aa752c6
f8fb6dd
ec6a0cf
eea71c3
0464b45
ca6a96e
e14a345
d5c4006
60fe601
bf11762
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,8 @@ | |
# sys | ||
"is_jython", "is_android", "is_emscripten", "is_wasi", | ||
"check_impl_detail", "unix_shell", "setswitchinterval", | ||
# os | ||
"get_pagesize", | ||
# network | ||
"open_urlresource", | ||
# processes | ||
|
@@ -1892,6 +1894,16 @@ def setswitchinterval(interval): | |
interval = minimum_interval | ||
return sys.setswitchinterval(interval) | ||
|
||
def get_pagesize(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll change https://github.com/python/cpython/blob/main/Lib/test/memory_watchdog.py#L13 to get_pagesize in other pr.
hyeongyun0916 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"""Get size of a page in bytes.""" | ||
try: | ||
page_size = os.sysconf('SC_PAGESIZE') | ||
except (ValueError, AttributeError): | ||
try: | ||
page_size = os.sysconf('SC_PAGE_SIZE') | ||
except (ValueError, AttributeError): | ||
page_size = 4096 | ||
return page_size | ||
hyeongyun0916 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
@contextlib.contextmanager | ||
def disable_faulthandler(): | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -6,6 +6,7 @@ | |||||
import struct | ||||||
import sys | ||||||
import unittest | ||||||
from test import support | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
from test.support import verbose, cpython_only | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
from test.support.import_helper import import_module | ||||||
from test.support.os_helper import TESTFN, unlink | ||||||
|
@@ -201,7 +202,8 @@ def test_fcntl_f_pipesize(self): | |||||
# Get the default pipesize with F_GETPIPE_SZ | ||||||
pipesize_default = fcntl.fcntl(test_pipe_w, fcntl.F_GETPIPE_SZ) | ||||||
pipesize = pipesize_default // 2 # A new value to detect change. | ||||||
if pipesize < 512: # the POSIX minimum | ||||||
pagesize_default = support.get_pagesize() | ||||||
if pipesize < pagesize_default: # the POSIX minimum | ||||||
raise unittest.SkipTest( | ||||||
'default pipesize too small to perform test.') | ||||||
fcntl.fcntl(test_pipe_w, fcntl.F_SETPIPE_SZ, pipesize) | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.