-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-102795: Fix use of poll in test_epoll's test_control_and_wait #102796
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
Conversation
This test can fail unnecessarily. In the test we wait for events on two file descriptors. This is done in a single call to select.epoll's poll() function. However, it is valid for the OS to return only one event via poll() and the next via a subsequent call to poll(). This rarely happens, but it can cause the test to fail despite properly functioning polling. Instead, we poll a second time when necessary. Fixes python#102795.
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
@vstinner (as a committer into |
Hum, maybe loop on calling this function until it returns even events? Maybe loop on |
Updated, PTAL. |
Hey, anything I can do to help move this? |
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
GH-104173 is a backport of this pull request to the 3.11 branch. |
pythonGH-102796) This test can fail unnecessarily. In the test we wait for events on two file descriptors. This is done in a single call to select.epoll's poll() function. However, it is valid for the OS to return only one event via poll() and the next via a subsequent call to poll(). This rarely happens, but it can cause the test to fail despite properly functioning polling. Instead, we poll a second time when necessary. (cherry picked from commit c9ecd3e) Co-authored-by: Kevin Krakauer <[email protected]>
Merged, thanks. I created a backport to Python 3.11. |
I didn't backport the fix since Python 3.11 doesn't have busy_wait(). |
This test can fail unnecessarily. In the test we wait for events on two file descriptors. This is done in a single call to select.epoll's poll() function. However, it is valid for the OS to return only one event via poll() and the next via a subsequent call to poll(). This rarely happens, but it can cause the test to fail despite properly functioning polling.
Instead, we poll a second time when necessary.
Fixes #102795.