diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-01-25 17:40:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-25 17:40:34 (GMT) |
commit | f9ff0bf515e0fa162889aca508e755cc65d85079 (patch) | |
tree | fa600a47c9bae56a0ff6af64295a62374c7d0fcb | |
parent | b0b8388a1c29dc9203dd1a9e8b1420a6a5e88c97 (diff) | |
download | cpython-f9ff0bf515e0fa162889aca508e755cc65d85079.zip cpython-f9ff0bf515e0fa162889aca508e755cc65d85079.tar.gz cpython-f9ff0bf515e0fa162889aca508e755cc65d85079.tar.bz2 |
bpo-41682: fixed flaky test test_sendfile_close_peer_in_the_middle_of_receiving (GH-30845) (#30861)
(cherry picked from commit 1c705fda8f9902906edd26d46acb0433b0b098e1)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
-rw-r--r-- | Lib/test/test_asyncio/test_sendfile.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/test/test_asyncio/test_sendfile.py b/Lib/test/test_asyncio/test_sendfile.py index 0ba966c..8e34ab4 100644 --- a/Lib/test/test_asyncio/test_sendfile.py +++ b/Lib/test/test_asyncio/test_sendfile.py @@ -87,9 +87,13 @@ class MyProto(asyncio.Protocol): class SendfileBase: - # 128 KiB plus small unaligned to buffer chunk - DATA = b"SendfileBaseData" * (1024 * 8 + 1) - + # 256 KiB plus small unaligned to buffer chunk + # Newer versions of Windows seems to have increased its internal + # buffer and tries to send as much of the data as it can as it + # has some form of buffering for this which is less than 256KiB + # on newer server versions and Windows 11. + # So DATA should be larger than 256 KiB to make this test reliable. + DATA = b"x" * (1024 * 256 + 1) # Reduce socket buffer size to test on relative small data sets. BUF_SIZE = 4 * 1024 # 4 KiB @@ -451,8 +455,6 @@ class SendfileMixin(SendfileBase): # themselves). @unittest.skipIf(sys.platform.startswith('sunos'), "Doesn't work on Solaris") - @unittest.skipIf(sys.platform == "win32", - "It is flaky on Windows and needs to be fixed") # TODO: bpo-41682 def test_sendfile_close_peer_in_the_middle_of_receiving(self): srv_proto, cli_proto = self.prepare_sendfile(close_after=1024) with self.assertRaises(ConnectionError): |