Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
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
gh-95672 skip fcntl when pipesize is smaller than pagesize #102163
Uh oh!
There was an error while loading. Please reload this page.
Conversation
hyeongyun0916 commented Feb 23, 2023 • edited by bedevere-bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-bot
Uh oh!
There was an error while loading. Please reload this page.
Lib/test/test_fcntl.py Outdated
| pipesize_default=fcntl.fcntl(test_pipe_w, fcntl.F_GETPIPE_SZ) | ||
| pipesize=pipesize_default//2# A new value to detect change. | ||
| ifpipesize<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 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
Lib/test/test_subprocess.py Outdated
| os.close(test_pipe_w) | ||
| pipesize=pipesize_default//2 | ||
| ifpipesize<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 comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
bedevere-bot commented Feb 23, 2023
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Lib/test/test_fcntl.py Outdated
| pipesize_default=fcntl.fcntl(test_pipe_w, fcntl.F_GETPIPE_SZ) | ||
| pipesize=pipesize_default//2# A new value to detect change. | ||
| ifpipesize<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. |
corona10Feb 23, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
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.
You need to describe why the os.sysconf('SC_PAGESIZE') is needed rather than describe the issue itself.
Lib/test/test_fcntl.py Outdated
| hasattr(fcntl, "F_SETPIPE_SZ") andhasattr(fcntl, "F_GETPIPE_SZ"), | ||
| "F_SETPIPE_SZ and F_GETPIPE_SZ are not available on all platforms.") | ||
| deftest_fcntl_f_pipesize(self): | ||
| resource=import_module('resource') |
corona10Feb 24, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
Why not just using import resource?
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.
Oh that's right, I'll fix it.
Lib/test/test_fcntl.py Outdated
| importstruct | ||
| importsys | ||
| importunittest | ||
| importresource |
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.
@hyeongyun0916 resource module looks like not available on Windows platform.
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.
I'll add a function to the test support.
| interval=minimum_interval | ||
| returnsys.setswitchinterval(interval) | ||
| defget_pagesize(): |
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.
I'll change https://github.com/python/cpython/blob/main/Lib/test/memory_watchdog.py#L13 to get_pagesize in other pr.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Lib/test/test_fcntl.py Outdated
| importsys | ||
| importunittest | ||
| fromtestimportsupport | ||
| fromtest.supportimportverbose, cpython_only |
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.
| fromtest.supportimportverbose, cpython_only | |
| fromtest.supportimportverbose, cpython_only, get_pagesize |
Lib/test/test_fcntl.py Outdated
| importstruct | ||
| importsys | ||
| importunittest | ||
| fromtestimportsupport |
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.
| from test import support |
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
corona10 left a comment
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.
lgtm!
Thanks for the hardwork!
skip fcntl when pipesize is smaller than pagesize