Skip to content

Commit ccc6c2b

Browse files
[3.12] gh-120226: Fix test_sendfile_close_peer_in_the_middle_of_receiving on Linux >= 6.10 (GH-120227) (#123422)
gh-120226: Fix test_sendfile_close_peer_in_the_middle_of_receiving on Linux >= 6.10 (GH-120227) The worst case is that the kernel buffers 17 pages with a page size of 64k. (cherry picked from commit a758424) Co-authored-by: Xi Ruoyao <[email protected]>
1 parent 248af25 commit ccc6c2b

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

Lib/test/test_asyncio/test_sendfile.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,10 @@ async def wait_closed(self):
9393

9494
class SendfileBase:
9595

96-
# 256 KiB plus small unaligned to buffer chunk
97-
# Newer versions of Windows seems to have increased its internal
98-
# buffer and tries to send as much of the data as it can as it
99-
# has some form of buffering for this which is less than 256KiB
100-
# on newer server versions and Windows 11.
101-
# So DATA should be larger than 256 KiB to make this test reliable.
102-
DATA = b"x" * (1024 * 256 + 1)
96+
# Linux >= 6.10 seems buffering up to 17 pages of data.
97+
# So DATA should be large enough to make this test reliable even with a
98+
# 64 KiB page configuration.
99+
DATA = b"x" * (1024 * 17 * 64 + 1)
103100
# Reduce socket buffer size to test on relative small data sets.
104101
BUF_SIZE = 4 * 1024 # 4 KiB
105102

0 commit comments

Comments
 (0)