Skip to content

Commit 35f66ab

Browse files
committed
fix: flaky IAM preparation
1 parent 5fa80f3 commit 35f66ab

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

integration_tests.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,17 @@ def _prepare_iam_instance():
650650
issuer = f"http://localhost:{IAM_PORT}"
651651

652652
typer.secho("Getting an IAM admin token", fg=c.GREEN)
653-
tokens = _get_iam_token(issuer, IAM_ADMIN_USER, IAM_ADMIN_PASSWORD, IAM_INIT_CLIENT_ID, IAM_INIT_CLIENT_SECRET)
653+
654+
# It sometimes takes a while for IAM to be ready so wait for a while if needed
655+
for _ in range(10):
656+
try:
657+
tokens = _get_iam_token(
658+
issuer, IAM_ADMIN_USER, IAM_ADMIN_PASSWORD, IAM_INIT_CLIENT_ID, IAM_INIT_CLIENT_SECRET
659+
)
660+
break
661+
except requests.ConnectionError:
662+
time.sleep(10)
663+
654664
admin_access_token = tokens.get("access_token")
655665

656666
typer.secho("Creating IAM clients", fg=c.GREEN)

0 commit comments

Comments
 (0)