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

Analyze and improve test_asyncio.py: right now it might be flaky #97546

Open
sobolevn opened this issue Sep 25, 2022 · 3 comments
Open

Analyze and improve test_asyncio.py: right now it might be flaky #97546

sobolevn opened this issue Sep 25, 2022 · 3 comments
Labels
expert-asyncio tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Sep 25, 2022

@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error expert-asyncio labels Sep 25, 2022
@sobolevn
Copy link
Member Author

sobolevn commented Sep 25, 2022

This might be related: #93357

@gvanrossum
Copy link
Member

gvanrossum commented Sep 27, 2022

Another possible source of flakiness is the use of small timeouts in tests, like 0.1 or even 0.01 seconds. Making the timeouts larger makes the tests run slower, but the short timeouts occasionally flake out. There should be other ways to wait for certain things to happen in most cases, like creating an Event object and awaiting that, instead of sleeping.

Longer timeouts (e.g. 1, 2 or 3 seconds) are less likely to be suspicious, timeouts like that are meant to be never hit unless the test is actually failing. Making these too long would just cause tests to take longer to report failure.

@AlexWaygood AlexWaygood added the tests Tests in the Lib/test dir label Sep 27, 2022
@kumaraditya303
Copy link
Contributor

kumaraditya303 commented Sep 29, 2022

See also #82504

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expert-asyncio tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
Status: Todo
Development

No branches or pull requests

4 participants