Skip to content
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

[3.11] gh-102795: Fix use of poll in test_epoll's test_control_and_wait (GH-102796) #104173

Closed

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented May 4, 2023

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 kevinGC@users.noreply.github.com

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 <kevinGC@users.noreply.github.com>
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good bot

@vstinner
Copy link
Member

vstinner commented May 6, 2023

Oh, Python 3.11 tets.support doesn't have busy_wait(). I added it to Python 3.12. I don't think that this very specific test enhancement is needed for 3.11. It's an old test.

@vstinner vstinner closed this May 6, 2023
@miss-islington miss-islington deleted the backport-c9ecd3e-3.11 branch May 6, 2023 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting merge tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants