diff --git a/tests/ci/get_robot_token.py b/tests/ci/get_robot_token.py index 11e1bd38250..a4317d5caff 100644 --- a/tests/ci/get_robot_token.py +++ b/tests/ci/get_robot_token.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import logging -from dataclasses import dataclass import random +from dataclasses import dataclass from typing import Any, Dict, List, Optional, Union import boto3 # type: ignore @@ -18,6 +18,9 @@ class Token: rest: int +SAFE_REQUESTS_LIMIT = 1000 + + def get_parameter_from_ssm( name: str, decrypt: bool = True, client: Optional[Any] = None ) -> str: @@ -94,7 +97,7 @@ def get_best_robot_token(tokens_path: str = "/github-tokens") -> str: best_token = Token(user, value, rest) elif best_token.rest < rest: best_token = Token(user, value, rest) - if best_token.rest > 300: + if best_token.rest > SAFE_REQUESTS_LIMIT: break assert best_token ROBOT_TOKEN = best_token