decrease requests default timeout to 9s (#73953) #66

Closed
Ghost wants to merge 1 commits from wip/73953-decrease-requests-timeout-to-9s-by-default into main
4 changed files with 5 additions and 5 deletions

View File

@ -232,9 +232,9 @@ PASSERELLE_MANAGE_COMMAND = None
REQUESTS_PROXIES = None
# timeout used in python-requests call, in seconds
# we use 25s by default: timeout just before web server, which is usually 30s,
# we use 9s by default: three times less than web server, which is usually 30s,
# and before clients, which usually use 28s (see w.c.s. or Combo)
REQUESTS_TIMEOUT = 25
REQUESTS_TIMEOUT = 9
# Retry all requests
# See: https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html#urllib3.util.Retry

View File

@ -421,7 +421,7 @@ def test_timeout(mocked_get, caplog, endpoint_response):
logger = logging.getLogger('requests')
Request(logger=logger).get('http://example.net/whatever')
assert mocked_get.call_args[1]['timeout'] == 25
assert mocked_get.call_args[1]['timeout'] == 9
Request(logger=logger).get('http://example.net/whatever', timeout=42)
assert mocked_get.call_args[1]['timeout'] == 42

View File

@ -196,7 +196,7 @@ def test_solis_ping(app, solis, ping_response):
assert requests_get.call_args[1]['verify'] is True
assert 'cert' not in requests_get.call_args[1]
assert 'proxies' not in requests_get.call_args[1]
assert requests_get.call_args[1]['timeout'] == 25
assert requests_get.call_args[1]['timeout'] == 9
# try certificates parameters
solis.verify_cert = False

View File

@ -735,7 +735,7 @@ def test_create_intervention_timeout(mocked_uuid, mocked_get, app, freezer, smar
freezer.move_to('2021-07-09 01:00:02')
smart.jobs()
assert mocked_get.call_count == 3
assert mocked_get.call_args_list[2][1]['timeout'] == 25
assert mocked_get.call_args_list[2][1]['timeout'] == 9
UPDATE_INTERVENTION_PAYLOAD = {