Skip to content

Commit 9301b00

Browse files
committed
Add boto3 retry to mitigate IAM throttling
Signed-off-by: Rex <shuningc@amazon.com>
1 parent 44b1aa2 commit 9301b00

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/integration-tests/conftest.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import configparser
2727
import pkg_resources
2828
import pytest
29+
from botocore.config import Config
2930
from cfn_stacks_factory import CfnStack, CfnStacksFactory
3031
from clusters_factory import Cluster, ClustersFactory
3132
from conftest_markers import (
@@ -674,7 +675,15 @@ def common_pcluster_policies(region):
674675
@pytest.fixture(scope="class")
675676
def role_factory(region):
676677
roles = []
677-
iam_client = boto3.client("iam", region_name=region)
678+
iam_client = boto3.client(
679+
"iam",
680+
region_name=region,
681+
config=Config(
682+
retries={
683+
"max_attempts": 10,
684+
}
685+
),
686+
)
678687

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

0 commit comments

Comments
 (0)