Armada timeout adjustment

This PS set read/connection timeout to None for http requests.

Change-Id: Ic874485bb82a9c386224f5adc530e366b01ae24e
This commit is contained in:
Sergiy Markin 2023-05-11 20:58:18 +00:00
parent b778f9faf8
commit 4be7fa44a7
4 changed files with 5 additions and 3 deletions

View File

@ -19,6 +19,7 @@ from oslo_log import log as logging
from armada import api from armada import api
from armada.common import policy from armada.common import policy
CONF = cfg.CONF CONF = cfg.CONF
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -110,7 +110,8 @@ class GitTestCase(base.ArmadaTestCase):
source.download_tarball(url) source.download_tarball(url)
mock_temp.mkstemp.assert_called_once() mock_temp.mkstemp.assert_called_once()
mock_requests.get.assert_called_once_with(url, timeout=5, verify=False) mock_requests.get.assert_called_once_with(
url, timeout=None, verify=False)
mock_open.assert_called_once_with('/tmp/armada', 'wb') mock_open.assert_called_once_with('/tmp/armada', 'wb')
mock_open().write.assert_called_once_with( mock_open().write.assert_called_once_with(
mock_requests.get(url).content) mock_requests.get(url).content)

View File

@ -135,7 +135,7 @@ def download_tarball(tarball_url, verify=False, proxy_server=None):
} }
tarball_filename = tempfile.mkstemp(prefix='armada')[1] tarball_filename = tempfile.mkstemp(prefix='armada')[1]
response = requests.get( response = requests.get(
tarball_url, timeout=5, verify=verify, **kwargs) tarball_url, timeout=None, verify=verify, **kwargs)
with open(tarball_filename, 'wb') as f: with open(tarball_filename, 'wb') as f:
f.write(response.content) f.write(response.content)

View File

@ -177,6 +177,6 @@ def validate_armada_documents(documents):
def validate_manifest_url(value): def validate_manifest_url(value):
try: try:
return (requests.get(value, timeout=5).status_code == 200) return (requests.get(value, timeout=None).status_code == 200)
except requests.exceptions.RequestException: except requests.exceptions.RequestException:
return False return False