diff --git a/integration/single/test_function_with_http_api_and_auth.py b/integration/single/test_function_with_http_api_and_auth.py index 22b9baef5..7a1d603fa 100644 --- a/integration/single/test_function_with_http_api_and_auth.py +++ b/integration/single/test_function_with_http_api_and_auth.py @@ -1,11 +1,27 @@ +import logging +from unittest.case import skipIf + +from tenacity import stop_after_attempt, retry_if_exception_type, after_log, wait_exponential, retry, wait_random + from integration.helpers.base_test import BaseTest +from integration.helpers.resource import current_region_does_not_support + +LOG = logging.getLogger(__name__) +@skipIf(current_region_does_not_support(["HttpApi"]), "HttpApi is not supported in this testing region") class TestFunctionWithHttpApiAndAuth(BaseTest): """ AWS::Lambda::Function tests with http api events and auth """ + @retry( + stop=stop_after_attempt(5), + wait=wait_exponential(multiplier=1, min=4, max=10) + wait_random(0, 1), + retry=retry_if_exception_type(AssertionError), + after=after_log(LOG, logging.WARNING), + reraise=True, + ) def test_function_with_http_api_and_auth(self): # If the request is not signed, which none of the below are, IAM will respond with a "Forbidden" message. # We are not testing that IAM auth works here, we are simply testing if it was applied.