File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
services/sts/src/it/java/software/amazon/awssdk/services/sts Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ public static void setup() {
109109 Waiter .run (() -> iam .createRole (r -> r .roleName (ROLE_NAME )
110110 .assumeRolePolicyDocument (rolePolicyDoc )))
111111 .ignoringException (MalformedPolicyDocumentException .class )
112- .orFailAfter (Duration .ofMinutes (2 ));
112+ .orFailAfter (Duration .ofMinutes (4 ));
113113 } catch (EntityAlreadyExistsException e ) {
114114 // Role already exists - awesome.
115115 }
@@ -129,11 +129,17 @@ public static void setup() {
129129 StsClient userCredentialSts = StsClient .builder ()
130130 .credentialsProvider (() -> userCredentials )
131131 .build ();
132+
133+ // Ensure the new credentials have propagated and are valid.
134+ Waiter .run (userCredentialSts ::getCallerIdentity )
135+ .ignoringException (StsException .class )
136+ .orFailAfter (Duration .ofMinutes (2 ));
137+
132138 Waiter .run (() -> userCredentialSts .assumeRole (r -> r .durationSeconds (SESSION_DURATION )
133139 .roleArn (ROLE_ARN )
134140 .roleSessionName ("Test" )))
135141 .ignoringException (StsException .class )
136- .orFailAfter (Duration .ofMinutes (5 ));
142+ .orFailAfter (Duration .ofMinutes (8 ));
137143 }
138144
139145 @ AfterClass
You can’t perform that action at this time.
0 commit comments