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

test_epoll.test_control_and_wait flakes from improper poll() usage #102795

Closed
kevinGC opened this issue Mar 17, 2023 · 0 comments · Fixed by #102796
Closed

test_epoll.test_control_and_wait flakes from improper poll() usage #102795

kevinGC opened this issue Mar 17, 2023 · 0 comments · Fixed by #102796
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@kevinGC
Copy link
Contributor

kevinGC commented Mar 17, 2023

Bug report

test_epoll.test_control_and_wait can flake. 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.

Your environment

  • CPython versions tested on: 3.10.2
  • Operating system and architecture: Linux 5.19.11 and gVisor

Linked PRs

@kevinGC kevinGC added the type-bug An unexpected behavior, bug, or error label Mar 17, 2023
kevinGC added a commit to kevinGC/cpython that referenced this issue Mar 17, 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.

Fixes python#102795.
copybara-service bot pushed a commit to google/gvisor that referenced this issue Mar 20, 2023
The test uses poll() incorrectly and flakes. Attempting to fix upstream:
python/cpython#102795

PiperOrigin-RevId: 518021055
@arhadthedev arhadthedev added the tests Tests in the Lib/test dir label Mar 23, 2023
vstinner pushed a commit that referenced this issue May 4, 2023
…2796)

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.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 4, 2023
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants