summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-10-05 18:54:27 (GMT)
committerGitHub <noreply@github.com>2023-10-05 18:54:27 (GMT)
commit0db2f1475e6539e1954e1f8bd53e005c3ecd6a26 (patch)
treee84c6d53135bdb631ac6cbf4bb850d1e591347c5
parent318f5df27109ff8d2519edefa771920a0ec62b92 (diff)
downloadcpython-0db2f1475e6539e1954e1f8bd53e005c3ecd6a26.zip
cpython-0db2f1475e6539e1954e1f8bd53e005c3ecd6a26.tar.gz
cpython-0db2f1475e6539e1954e1f8bd53e005c3ecd6a26.tar.bz2
gh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (#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.
-rw-r--r--Lib/test/libregrtest/setup.py2
-rw-r--r--Lib/test/support/__init__.py8
2 files changed, 3 insertions, 7 deletions
diff --git a/Lib/test/libregrtest/setup.py b/Lib/test/libregrtest/setup.py
index cb410da..793347f 100644
--- a/Lib/test/libregrtest/setup.py
+++ b/Lib/test/libregrtest/setup.py
@@ -111,6 +111,8 @@ def setup_tests(runtests: RunTests):
timeout = runtests.timeout
if timeout is not None:
# For a slow buildbot worker, increase SHORT_TIMEOUT and LONG_TIMEOUT
+ support.LOOPBACK_TIMEOUT = max(support.LOOPBACK_TIMEOUT, timeout / 120)
+ # don't increase INTERNET_TIMEOUT
support.SHORT_TIMEOUT = max(support.SHORT_TIMEOUT, timeout / 40)
support.LONG_TIMEOUT = max(support.LONG_TIMEOUT, timeout / 4)
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 900b9c9..f3270d6 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -75,13 +75,7 @@ __all__ = [
#
# The timeout should be long enough for connect(), recv() and send() methods
# of socket.socket.
-LOOPBACK_TIMEOUT = 5.0
-if sys.platform == 'win32' and ' 32 bit (ARM)' in sys.version:
- # bpo-37553: test_socket.SendfileUsingSendTest is taking longer than 2
- # seconds on Windows ARM32 buildbot
- LOOPBACK_TIMEOUT = 10
-elif sys.platform == 'vxworks':
- LOOPBACK_TIMEOUT = 10
+LOOPBACK_TIMEOUT = 10.0
# Timeout in seconds for network requests going to the internet. The timeout is
# short enough to prevent a test to wait for too long if the internet request