File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1023,7 +1023,16 @@ def test_large_content_length(self):
10231023 self .assertEqual (res .read (), b'%d %d' % (size , size ) + self .linesep )
10241024
10251025 def test_large_content_length_truncated (self ):
1026- with support .swap_attr (self .request_handler , 'timeout' , support .LOOPBACK_TIMEOUT ):
1026+ timeout = support .LOOPBACK_TIMEOUT
1027+ if not hasattr (os , 'fork' ):
1028+ # On Windows, request() waits for the entire timeout; the default
1029+ # LOOPBACK_TIMEOUT (10s) is too long for 40 repetitions.
1030+ # Use a fraction of that (for slow machines), or .001 (in case
1031+ # LOOPBACK_TIMEOUT is configured to be smaller).
1032+ timeout = max (timeout / 100 , 0.001 )
1033+ # (On Unix, request() returns early so a large LOOPBACK_TIMEOUT
1034+ # isn't an issue.)
1035+ with support .swap_attr (self .request_handler , 'timeout' , timeout ):
10271036 for w in range (18 , 65 ):
10281037 size = 1 << w
10291038 headers = {'Content-Length' : str (size )}
You can’t perform that action at this time.
0 commit comments