bpo-33353: test_asyncio use set_write_buffer_limits() by vstinner · Pull Request #7200 · python/cpython (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation5 Commits2 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Use transport.set_write_buffer_limits() in sendfile tests of
test_asyncio to make sure that the protocol is paused after sending
1024 bytes. Previously,
test_sendfile_fallback_close_peer_in_the_middle_of_receiving() failed
on FreeBSD if the DATA was smaller than the default limit of 64 KiB.
https://bugs.python.org/issue33353
Use transport.set_write_buffer_limits() in sendfile tests of test_asyncio to make sure that the protocol is paused after sending 1024 bytes. Previously, test_sendfile_fallback_close_peer_in_the_middle_of_receiving() failed on FreeBSD if the DATA was smaller than the default limit of 64 KiB.
Crap, a test failed on AppVeyor:
FAIL: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_events.ProactorEventLoopTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\projects\cpython\lib\test\test_asyncio\test_events.py", line 2506, in test_sendfile_close_peer_in_the_middle_of_receiving
self.file.tell())
AssertionError: False is not true : 65536
- Windows: use 128 KiB of data, instead of 64 KiB, to workaround issues on selector and proactor event loops
- FreeBSD: use 4 KiB, instead of 1 KiB, for the buffer size
With "Fix sendfile tests on Windows, commit 3758248":
- test_asyncio sendfile tests pass on my Windows VM, FreeBSD VM and Linux
Timings:
- Windows VM: 3 sec
- FreeBSD: 17 sec
- Linux: 3 sec
Once, sendfile tests took longer than 1 min on Windows. I interrupted the tests to check that I was on the correct branch, but then I was unable to reproduce the slowdown... Another strange issue...
vstinner deleted the asyncio_write_buflimit branch
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
Use transport.set_write_buffer_limits() in sendfile tests of test_asyncio to make sure that the protocol is paused after sending 4 KiB. Previously, test_sendfile_fallback_close_peer_in_the_middle_of_receiving() failed on FreeBSD if the DATA was smaller than the default limit of 64 KiB. (cherry picked from commit 9551f77)
Co-authored-by: Victor Stinner vstinner@redhat.com
miss-islington added a commit that referenced this pull request
Use transport.set_write_buffer_limits() in sendfile tests of test_asyncio to make sure that the protocol is paused after sending 4 KiB. Previously, test_sendfile_fallback_close_peer_in_the_middle_of_receiving() failed on FreeBSD if the DATA was smaller than the default limit of 64 KiB. (cherry picked from commit 9551f77)
Co-authored-by: Victor Stinner vstinner@redhat.com