-
-
Notifications
You must be signed in to change notification settings - Fork 32k
GH-109067: fix randomly failing test_async_gen_asyncio_gc_aclose_09
test
#109142
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
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.
Great. Let's kill more short sleeps! They always cause problems.
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.
Thank you!
Can you explain why this was flakily failing on Windows, on why this fixes it? It's not obviously apparent to me from the code change
On Windows the monotonic clock is low precision so it distorts the test. |
I confirm that the fix works as expected. On Linux, it's hard for me to reproduce the issue. But on Windows, it's quite easy with the command:
It fails in a few seconds. I ran the test in a Windows VM with 2 CPUs (running on my laptop which has 12 threads / 6 CPU cores). With this PR, the test no longer fails. I interrupted the test for a few minutes:
To confirm the fix, I ran a second test on the PR on the whole test_asyncgen test module (without filtering on
|
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 @kumaraditya303 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
…se_09` test (pythonGH-109142) Use `asyncio.sleep(0)` instead of short sleeps. (cherry picked from commit ccd4862) Co-authored-by: Kumar Aditya <[email protected]>
…se_09` test (pythonGH-109142) Use `asyncio.sleep(0)` instead of short sleeps. (cherry picked from commit ccd4862) Co-authored-by: Kumar Aditya <[email protected]>
GH-109149 is a backport of this pull request to the 3.12 branch. |
GH-109150 is a backport of this pull request to the 3.11 branch. |
Uh oh!
There was an error while loading. Please reload this page.