Skip to content

Commit 331d90f

Browse files
[3.11] [3.12] gh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (GH-110413) (GH-110427) (#110440)
[3.12] gh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (GH-110413) (GH-110427) gh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (GH-110413) Increase support.LOOPBACK_TIMEOUT from 5 to 10 seconds. Also increase the timeout depending on the --timeout option. For example, for a test timeout of 40 minutes (ARM Raspbian 3.x), use LOOPBACK_TIMEOUT of 20 seconds instead of 5 seconds before. (cherry picked from commit 350d89b) Co-authored-by: Victor Stinner <[email protected]> (cherry picked from commit 0db2f14) Co-authored-by: Victor Stinner <[email protected]>
1 parent 779481e commit 331d90f

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

Lib/test/libregrtest/setup.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,19 @@ def _test_audit_hook(name, args):
8888
setup_unraisable_hook()
8989
setup_threading_excepthook()
9090

91-
if ns.timeout is not None:
91+
timeout = ns.timeout
92+
if timeout is not None:
9293
# For a slow buildbot worker, increase SHORT_TIMEOUT and LONG_TIMEOUT
93-
support.SHORT_TIMEOUT = max(support.SHORT_TIMEOUT, ns.timeout / 40)
94-
support.LONG_TIMEOUT = max(support.LONG_TIMEOUT, ns.timeout / 4)
94+
support.LOOPBACK_TIMEOUT = max(support.LOOPBACK_TIMEOUT, timeout / 120)
95+
# don't increase INTERNET_TIMEOUT
96+
support.SHORT_TIMEOUT = max(support.SHORT_TIMEOUT, timeout / 40)
97+
support.LONG_TIMEOUT = max(support.LONG_TIMEOUT, timeout / 4)
9598

9699
# If --timeout is short: reduce timeouts
97-
support.LOOPBACK_TIMEOUT = min(support.LOOPBACK_TIMEOUT, ns.timeout)
98-
support.INTERNET_TIMEOUT = min(support.INTERNET_TIMEOUT, ns.timeout)
99-
support.SHORT_TIMEOUT = min(support.SHORT_TIMEOUT, ns.timeout)
100-
support.LONG_TIMEOUT = min(support.LONG_TIMEOUT, ns.timeout)
100+
support.LOOPBACK_TIMEOUT = min(support.LOOPBACK_TIMEOUT, timeout)
101+
support.INTERNET_TIMEOUT = min(support.INTERNET_TIMEOUT, timeout)
102+
support.SHORT_TIMEOUT = min(support.SHORT_TIMEOUT, timeout)
103+
support.LONG_TIMEOUT = min(support.LONG_TIMEOUT, timeout)
101104

102105
if ns.xmlpath:
103106
from test.support.testresult import RegressionTestResult

Lib/test/support/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,7 @@
7272
#
7373
# The timeout should be long enough for connect(), recv() and send() methods
7474
# of socket.socket.
75-
LOOPBACK_TIMEOUT = 5.0
76-
if sys.platform == 'win32' and ' 32 bit (ARM)' in sys.version:
77-
# bpo-37553: test_socket.SendfileUsingSendTest is taking longer than 2
78-
# seconds on Windows ARM32 buildbot
79-
LOOPBACK_TIMEOUT = 10
80-
elif sys.platform == 'vxworks':
81-
LOOPBACK_TIMEOUT = 10
75+
LOOPBACK_TIMEOUT = 10.0
8276

8377
# Timeout in seconds for network requests going to the internet. The timeout is
8478
# short enough to prevent a test to wait for too long if the internet request

0 commit comments

Comments
 (0)