GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.14] test_httpservers: Don't use the full LOOPBACK_TIMEOUT on Windows · python/cpython@716f710

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Lib/test
    • test_httpservers.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Lib/test/test_httpservers.py‎

Copy file name to clipboardExpand all lines: Lib/test/test_httpservers.py
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,16 @@ def test_large_content_length(self):
11341134
self.assertEqual(res.read(), b'%d %d' % (size, size) + self.linesep)
11351135

11361136
def test_large_content_length_truncated(self):
1137-
with support.swap_attr(self.request_handler, 'timeout', support.LOOPBACK_TIMEOUT):
1137+
timeout = support.LOOPBACK_TIMEOUT
1138+
if not hasattr(os, 'fork'):
1139+
# On Windows, request() waits for the entire timeout; the default
1140+
# LOOPBACK_TIMEOUT (10s) is too long for 40 repetitions.
1141+
# Use a fraction of that (for slow machines), or .001 (in case
1142+
# LOOPBACK_TIMEOUT is cunfigured to be smaller).
1143+
timeout = max(timeout / 100, 0.001)
1144+
# (On Unix, request() returns early so a large LOOPBACK_TIMEOUT
1145+
# isn't an issue.)
1146+
with support.swap_attr(self.request_handler, 'timeout', timeout):
11381147
for w in range(18, 65):
11391148
size = 1 << w
11401149
headers = {'Content-Length' : str(size)}

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.