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() {
109
109
Waiter .run (() -> iam .createRole (r -> r .roleName (ROLE_NAME )
110
110
.assumeRolePolicyDocument (rolePolicyDoc )))
111
111
.ignoringException (MalformedPolicyDocumentException .class )
112
- .orFailAfter (Duration .ofMinutes (2 ));
112
+ .orFailAfter (Duration .ofMinutes (4 ));
113
113
} catch (EntityAlreadyExistsException e ) {
114
114
// Role already exists - awesome.
115
115
}
@@ -129,11 +129,17 @@ public static void setup() {
129
129
StsClient userCredentialSts = StsClient .builder ()
130
130
.credentialsProvider (() -> userCredentials )
131
131
.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
+
132
138
Waiter .run (() -> userCredentialSts .assumeRole (r -> r .durationSeconds (SESSION_DURATION )
133
139
.roleArn (ROLE_ARN )
134
140
.roleSessionName ("Test" )))
135
141
.ignoringException (StsException .class )
136
- .orFailAfter (Duration .ofMinutes (5 ));
142
+ .orFailAfter (Duration .ofMinutes (8 ));
137
143
}
138
144
139
145
@ AfterClass
You can’t perform that action at this time.
0 commit comments