[3.14] gh-154366: Fix test_asyncio.test_sendfile timing out on DragonFly BSD (GH-154367) (GH-154372)

serhiy-storchaka <[email protected]>
Newsgroups gmane.comp.python.cvs
Message-ID <[email protected]>
https://github.com/python/cpython/commit/1f0cbea50b3eb1d57ea2328ed1101c4ec82c1f9e
commit: 1f0cbea50b3eb1d57ea2328ed1101c4ec82c1f9e
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-07-21T15:31:47Z
summary:

[3.14] gh-154366: Fix test_asyncio.test_sendfile timing out on DragonFly BSD (GH-154367) (GH-154372)

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.
(cherry picked from commit a6e1b836ec5055cbc8be477ca0c2df0cc12b8cb5)

Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>

files:
M Lib/test/test_asyncio/test_sendfile.py

diff --git a/Lib/test/test_asyncio/test_sendfile.py b/Lib/test/test_asyncio/test_sendfile.py
index 7afd7de3bb936e6..bdc3aa604a158f3 100644
--- a/Lib/test/test_asyncio/test_sendfile.py
+++ b/Lib/test/test_asyncio/test_sendfile.py
@@ -98,7 +98,12 @@ class SendfileBase:
     # 64 KiB page configuration.
     DATA = b"x" * (1024 * 17 * 64 + 1)
     # Reduce socket buffer size to test on relative small data sets.
-    BUF_SIZE = 4 * 1024   # 4 KiB
+    if sys.platform.startswith('dragonfly'):
+        # A smaller buffer makes every window update wait 100 ms for the
+        # delayed ACK timer.
+        BUF_SIZE = 32 * 1024  # 32 KiB
+    else:
+        BUF_SIZE = 4 * 1024   # 4 KiB
 
     def create_event_loop(self):
         raise NotImplementedError

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.