This is an automated email from the ASF dual-hosted git repository.

vincbeck pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new cb4c836becc Add delay in `example_emr_eks` after updating execution 
role (#62415)
cb4c836becc is described below

commit cb4c836beccdb23ac9a29df3f91f8ddee86d6d12
Author: Vincent <[email protected]>
AuthorDate: Tue Feb 24 16:17:12 2026 -0500

    Add delay in `example_emr_eks` after updating execution role (#62415)
---
 providers/amazon/tests/system/amazon/aws/example_emr_eks.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/providers/amazon/tests/system/amazon/aws/example_emr_eks.py 
b/providers/amazon/tests/system/amazon/aws/example_emr_eks.py
index 6c703dc8c35..86c59cf6916 100644
--- a/providers/amazon/tests/system/amazon/aws/example_emr_eks.py
+++ b/providers/amazon/tests/system/amazon/aws/example_emr_eks.py
@@ -18,6 +18,7 @@ from __future__ import annotations
 
 import json
 import subprocess
+import time
 from datetime import datetime
 
 import boto3
@@ -57,6 +58,7 @@ ROLE_ARN_KEY = "ROLE_ARN"
 JOB_ROLE_ARN_KEY = "JOB_ROLE_ARN"
 JOB_ROLE_NAME_KEY = "JOB_ROLE_NAME"
 SUBNETS_KEY = "SUBNETS"
+UPDATE_TRUST_POLICY_WAIT_TIME_KEY = "UPDATE_TRUST_POLICY_WAIT_TIME_KEY"
 
 sys_test_context_task = (
     SystemTestContextBuilder()
@@ -64,6 +66,7 @@ sys_test_context_task = (
     .add_variable(JOB_ROLE_ARN_KEY)
     .add_variable(JOB_ROLE_NAME_KEY)
     .add_variable(SUBNETS_KEY, split_string=True)
+    .add_variable(UPDATE_TRUST_POLICY_WAIT_TIME_KEY, optional=True, 
default_value=10)
     .build()
 )
 
@@ -137,7 +140,7 @@ def delete_iam_oidc_identity_provider(cluster_name):
 
 
 @task
-def update_trust_policy_execution_role(cluster_name, cluster_namespace, 
role_name):
+def update_trust_policy_execution_role(cluster_name, cluster_namespace, 
role_name, wait_time):
     # Remove any already existing trusted entities added with 
"update-role-trust-policy"
     # Prevent getting an error "Cannot exceed quota for ACLSizePerRole"
     client = boto3.client("iam")
@@ -173,6 +176,9 @@ def update_trust_policy_execution_role(cluster_name, 
cluster_namespace, role_nam
     if build.returncode != 0:
         raise RuntimeError(err)
 
+    # Wait for IAM changes to propagate to avoid authentication failures
+    time.sleep(wait_time)
+
 
 @task(trigger_rule=TriggerRule.ALL_DONE)
 def delete_virtual_cluster(virtual_cluster_id):
@@ -193,6 +199,7 @@ with DAG(
     subnets = test_context[SUBNETS_KEY]
     job_role_arn = test_context[JOB_ROLE_ARN_KEY]
     job_role_name = test_context[JOB_ROLE_NAME_KEY]
+    update_trust_policy_wait_time = 
test_context[UPDATE_TRUST_POLICY_WAIT_TIME_KEY]
 
     s3_bucket_name = f"{env_id}-bucket"
     eks_cluster_name = f"{env_id}-cluster"
@@ -316,7 +323,9 @@ with DAG(
         create_cluster_and_nodegroup,
         await_create_nodegroup,
         run_eksctl_commands(eks_cluster_name, eks_namespace),
-        update_trust_policy_execution_role(eks_cluster_name, eks_namespace, 
job_role_name),
+        update_trust_policy_execution_role(
+            eks_cluster_name, eks_namespace, job_role_name, 
update_trust_policy_wait_time
+        ),
         # TEST BODY
         create_emr_eks_cluster,
         job_starter,

Reply via email to