File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 configured 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 )}
You can’t perform that action at this time.
0 commit comments