From aa8cdf27e282f48981fca4c68b010cd04dc61213 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Thu, 15 Apr 2021 16:53:41 -0300 Subject: [PATCH] 17171: Sets default timeout on arvados.api() to 10 seconds. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- sdk/python/arvados/api.py | 2 +- sdk/python/tests/test_api.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/python/arvados/api.py b/sdk/python/arvados/api.py index 1d8a130450..4fe3999f2c 100644 --- a/sdk/python/arvados/api.py +++ b/sdk/python/arvados/api.py @@ -157,7 +157,7 @@ def http_cache(data_type): return cache.SafeHTTPCache(path, max_age=60*60*24*2) def api(version=None, cache=True, host=None, token=None, insecure=False, - request_id=None, timeout=None, **kwargs): + request_id=None, timeout=10, **kwargs): """Return an apiclient Resources object for an Arvados instance. :version: diff --git a/sdk/python/tests/test_api.py b/sdk/python/tests/test_api.py index 8fb364356f..60183e06a3 100644 --- a/sdk/python/tests/test_api.py +++ b/sdk/python/tests/test_api.py @@ -104,8 +104,8 @@ class ArvadosApiTest(run_test_server.TestCaseWithServers): # Checks for bug #17171 def test_default_request_timeout(self): api = arvados.api('v1') - self.assertEqual(api._http.timeout, None, - "Default timeout value shouldn't be set") + self.assertEqual(api._http.timeout, 10, + "Default timeout value should be 10") def test_ordered_json_model(self): mock_responses = { -- 2.30.2