[3.10] bpo-41682: fixed flaky test test_sendfile_close_peer_in_the_middle_of_receiving (GH-30845) by miss-islington · Pull Request #30860 · python/cpython
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