diff options
author | Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> | 2022-01-24 21:04:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-24 21:04:47 (GMT) |
commit | 1c705fda8f9902906edd26d46acb0433b0b098e1 (patch) | |
tree | 10de31eb37606ec282e32e4c7979b121a9f7d534 /Lib/test/test_asyncio/test_sendfile.py | |
parent | d5fd438b38248a0d2e91898475369361e34f74b7 (diff) | |
download | cpython-1c705fda8f9902906edd26d46acb0433b0b098e1.zip cpython-1c705fda8f9902906edd26d46acb0433b0b098e1.tar.gz cpython-1c705fda8f9902906edd26d46acb0433b0b098e1.tar.bz2 |
fixed flaky test (GH-30845)
Diffstat (limited to 'Lib/test/test_asyncio/test_sendfile.py')
-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 c8bfa89..effca66 100644 --- a/Lib/test/test_asyncio/test_sendfile.py +++ b/Lib/test/test_asyncio/test_sendfile.py @@ -92,9 +92,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 @@ -456,8 +460,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): |