Skip to content

Commit a6e1b83

Browse files
gh-154366: Fix test_asyncio.test_sendfile timing out on DragonFly BSD (GH-154367)
A 4 KiB receive buffer makes DragonFly defer every window update to the delayed ACK timer, so each buffer worth of data costs 100 ms. Use a larger socket buffer there; it is still small enough to pause the protocol long before all data is sent. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent bfd774d commit a6e1b83

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Lib/test/test_asyncio/test_sendfile.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,12 @@ class SendfileBase:
9898
# 64 KiB page configuration.
9999
DATA = b"x" * (1024 * 17 * 64 + 1)
100100
# Reduce socket buffer size to test on relative small data sets.
101-
BUF_SIZE = 4 * 1024 # 4 KiB
101+
if sys.platform.startswith('dragonfly'):
102+
# A smaller buffer makes every window update wait 100 ms for the
103+
# delayed ACK timer.
104+
BUF_SIZE = 32 * 1024 # 32 KiB
105+
else:
106+
BUF_SIZE = 4 * 1024 # 4 KiB
102107

103108
def create_event_loop(self):
104109
raise NotImplementedError

0 commit comments

Comments
 (0)