Skip to content

Commit

Permalink
Add boto3 retry to mitigate IAM throttling
Browse files Browse the repository at this point in the history
Signed-off-by: Rex <[email protected]>
  • Loading branch information
rexcsn committed May 14, 2021
1 parent 44b1aa2 commit 9301b00
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/integration-tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import configparser
import pkg_resources
import pytest
from botocore.config import Config
from cfn_stacks_factory import CfnStack, CfnStacksFactory
from clusters_factory import Cluster, ClustersFactory
from conftest_markers import (
Expand Down Expand Up @@ -674,7 +675,15 @@ def common_pcluster_policies(region):
@pytest.fixture(scope="class")
def role_factory(region):
roles = []
iam_client = boto3.client("iam", region_name=region)
iam_client = boto3.client(
"iam",
region_name=region,
config=Config(
retries={
"max_attempts": 10,
}
),
)

def create_role(trusted_service, policies=()):
iam_role_name = f"integ-tests_{trusted_service}_{region}_{random_alphanumeric()}"
Expand Down

0 comments on commit 9301b00

Please sign in to comment.