From: Brett Smith Date: Thu, 18 May 2023 12:48:13 +0000 (-0400) Subject: 12684: Test that plain 403 responses are not retried X-Git-Tag: 2.7.0~106^2 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/5d0b205148026b44c7f1bd30448c5429d0918d16 12684: Test that plain 403 responses are not retried Requested in review. Arvados-DCO-1.1-Signed-off-by: Brett Smith --- diff --git a/sdk/python/tests/test_api.py b/sdk/python/tests/test_api.py index e54f387b39..8667d5160c 100644 --- a/sdk/python/tests/test_api.py +++ b/sdk/python/tests/test_api.py @@ -168,7 +168,10 @@ class ArvadosApiTest(run_test_server.TestCaseWithServers): def test_4xx_not_retried(self): client = arvados.api('v1', num_retries=3) - for code in [400, 401, 404, 422]: + # Note that googleapiclient does retry 403 *if* the response JSON + # includes flags that say the request was denied by rate limiting. + # An empty JSON response like we use here should not be retried. + for code in [400, 401, 403, 404, 422]: with self.subTest(f'error {code}'), mock.patch('time.sleep'): with mock_api_responses( client,