You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
asyncio: sendfile tests ignore SO_SNDBUF on Windows #77864
Follow-up of bpo-33353: On my PR 7200, test_sendfile_close_peer_in_the_middle_of_receiving() failed on Windows (AppVeyor) :-(
For the SelectorEventLoop, it seems like sock.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 1024) doesn't work as intented: sock.send(<16384 bytes>) returns 16384, as the 1024 limit is not taken in account :-(
Same issue for the ProactorEventLoop...
I'm not sure if it's a bug in asyncio, a bug (limitation) of Windows which ignores SO_SNDBUF, or something else...
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_receivingself.file.tell())
AssertionError: False is not true : 65536
--
In bpo-33353, I worked around the bug in my commit 9551f77 by using a buffer of 128 KiB instead of 64 KiB.
Activity
vstinner commentedon May 29, 2018
Follow-up of bpo-33353: On my PR 7200, test_sendfile_close_peer_in_the_middle_of_receiving() failed on Windows (AppVeyor) :-(
For the SelectorEventLoop, it seems like sock.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 1024) doesn't work as intented: sock.send(<16384 bytes>) returns 16384, as the 1024 limit is not taken in account :-(
Same issue for the ProactorEventLoop...
I'm not sure if it's a bug in asyncio, a bug (limitation) of Windows which ignores SO_SNDBUF, or something else...
vstinner commentedon May 29, 2018
The failure was:
FAIL: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_events.ProactorEventLoopTests)
----------------------------------------------------------------------
--
In bpo-33353, I worked around the bug in my commit 9551f77 by using a buffer of 128 KiB instead of 64 KiB.