-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Disable retry in tests #9141
Comments
Can I be assigned this? I will try to get this as part of the hacktoberfest event... |
Go ahead. |
Hi Sam, this is my first time contributing to open-source and working with such a huge codebase. Can you guide me a bit on what is required to be done..? |
@ShubhAgarwal-dev this needs understanding how the tests work, inspecting them and making sure they disable retries, essentially not hitting the block under the linked line of code. Perhaps, running the tests locally and generating an HTML coverage report would reveal which tests hit said line. What's needed is probably finding where @Dreamsorcerer perhaps we shouldn't mark issues as |
Well, basically we want the linked line in the original post to always be False. So, we could probably add a new argument to ClientSession, or a private attribute maybe which defaults that variable to True normally, but False in the tests. The ClientSession for TestClient is created at: Line 296 in 25b67b6
So, that's where we'll need to pass the parameter or modify the private attribute.
I think the above is sufficient, no need to verify coverage etc. or have deeper knowledge of the code. Once a rough implementation is ready, we can figure out a test to verify the behaviour. |
I'd probably suggest the private attribute initially, and keep it as an implementation detail. If users ask for this to be configurable in future, then we can consider adding a new parameter. |
Is there anything left in this issue..? |
Ah, forgot to update the PR. If you include 'Fixes #9141' in the PR description next time, then the issue would be auto-closed. |
The client now has retry logic (
aiohttp/aiohttp/client.py
Line 642 in ba51537
We should disable the retry logic by default in tests (e.g. when using TestClient).
The text was updated successfully, but these errors were encountered: