Add keepalive_timeout parameter to web.run_app#5095
Add keepalive_timeout parameter to web.run_app#5095webknjaz merged 16 commits intoaio-libs:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5095 +/- ##
==========================================
+ Coverage 97.63% 97.64% +0.01%
==========================================
Files 43 43
Lines 8999 8999
Branches 1413 1413
==========================================
+ Hits 8786 8787 +1
+ Misses 99 98 -1
Partials 114 114
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
tests/test_run_app.py
Outdated
| exc_handler.assert_called_with(patched_loop, msg) | ||
|
|
||
|
|
||
| def test_run_app_keepalive_timeout(patched_loop): |
There was a problem hiding this comment.
It's usually better to use the mocker fixture from pytest-mock (it's already integrated as a test dependency) for accessing the MagicMock class.
There was a problem hiding this comment.
Sure, I can update it. What exactly is the benefit of using the fixture?
There was a problem hiding this comment.
Just the consistency: if the lib is integrated, the expectation is that it would be used. Also, pytest design is more fixture-driven so external things seem foreign.
There was a problem hiding this comment.
Got it. I can change this (and the rest of the comments) if @asvetlov agrees with the feature itself.
tests/test_run_app.py
Outdated
| base_runner_init_mock(*args, **kwargs) | ||
| base_runner_init_orig(self, *args, **kwargs) | ||
|
|
||
| with mock.patch.object(BaseRunner, "__init__", base_runner_init_spy): |
There was a problem hiding this comment.
It's better to use the built-in monkeypatch fixture for patching things.
Also, it's best to only patch the line that relies on patching, not many lines because you may accidentally create unintended side-effects with this.
tests/test_run_app.py
Outdated
| base_runner_init_orig = BaseRunner.__init__ | ||
|
|
||
| def base_runner_init_spy(self, *args, **kwargs): | ||
| base_runner_init_mock(*args, **kwargs) |
There was a problem hiding this comment.
It looks like it'd be much cleaner to just do
| base_runner_init_mock(*args, **kwargs) | |
| assert kwargs["keepalive_timeout"] == new_timeout |
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
|
@webknjaz please feel free to merge the PR when you are okay with it. |
Co-authored-by: Andrew Svetlov <[email protected]>
docs/web_reference.rst
Outdated
| closed after a HTTP request. The delay | ||
| allows for reuse of a TCP connection. | ||
|
|
||
| .. versionadded:: 3.7 |
There was a problem hiding this comment.
| .. versionadded:: 3.7 | |
| .. versionadded:: 3.8 |
Sorry, the time window for 3.1 is closed.
|
@asvetlov is there any agreed-upon autoformatting tool that could help me resolve the conflicts? |
|
You can try the following:
|
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
💔 Backport was not successfulThe PR was attempted backported to the following branches:
|
PR #5095 by @Teyras Co-authored-by: Sviatoslav Sydorenko <[email protected]> Co-authored-by: Andrew Svetlov <[email protected]>
|
@webknjaz please backport manually next time if the bot fails. |
|
Oh, I probably missedmisse that among my notifications. I think it's also a good idea to encourage the submitters to do their backports when they are as interested in the change. |
Agree, ask for the submitter to make backport PR using |
|
For the note, backported to 3.8 by e88dc8a |
PR aio-libs#5095 by @Teyras Co-authored-by: Sviatoslav Sydorenko <[email protected]> Co-authored-by: Andrew Svetlov <[email protected]>
PR aio-libs#5095 by @Teyras Co-authored-by: Sviatoslav Sydorenko <[email protected]> Co-authored-by: Andrew Svetlov <[email protected]>
What do these changes do?
Add keepalive_timeout parameter to web.run_app. Closes #5094.
Are there changes in behavior for the user?
Unlikely.
Related issue number
Checklist
CONTRIBUTORS.txtCHANGESfolder<issue_id>.<type>for example (588.bugfix)issue_idchange it to the pr id after creating the pr.feature: Signifying a new feature..bugfix: Signifying a bug fix..doc: Signifying a documentation improvement..removal: Signifying a deprecation or removal of public API..misc: A ticket has been closed, but it is not of interest to users.