-
-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
gh-95672 skip fcntl when pipesize is smaller than pagesize #102163
Changes from 1 commit
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 |
---|---|---|
|
@@ -201,7 +201,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 | ||
minimum_pipe_size = os.sysconf('SC_PAGESIZE') # There's a check that attempts to skip the tests if the pipe capacity is 512 bytes, but that's less than the smallest page size on x86. | ||
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.
You need to describe why the os.sysconf('SC_PAGESIZE') is needed rather than describe the issue itself. |
||
if pipesize < minimum_pipe_size: # the POSIX minimum | ||
raise unittest.SkipTest( | ||
'default pipesize too small to perform test.') | ||
fcntl.fcntl(test_pipe_w, fcntl.F_SETPIPE_SZ, pipesize) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -717,7 +717,8 @@ def test_pipesizes(self): | |
os.close(test_pipe_r) | ||
os.close(test_pipe_w) | ||
pipesize = pipesize_default // 2 | ||
if pipesize < 512: # the POSIX minimum | ||
minimum_pipe_size = os.sysconf('SC_PAGESIZE') # There's a check that attempts to skip the tests if the pipe capacity is 512 bytes, but that's less than the smallest page size on x86. | ||
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. ditto |
||
if pipesize < minimum_pipe_size: # the POSIX minimum | ||
raise unittest.SkipTest( | ||
'default pipesize too small to perform test.') | ||
p = subprocess.Popen( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow PEP8: https://peps.python.org/pep-0008/#maximum-line-length