Skip to content

Commit 8f588af

Browse files
committed
test: increase reset event wait timeout
1 parent 1b4a5da commit 8f588af

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/test/java/fr/cnieg/keycloak/providers/login/attribute/KeycloakLoginAttributeProviderTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private KeycloakEvent awaitLoginErrorEvent(String username, String expectedError
170170
}
171171

172172
private KeycloakEvent awaitResetPasswordEvent(String... usernames) {
173-
return eventsClient.awaitEvent(event -> isResetPasswordEvent(event)
173+
return eventsClient.awaitEvent(Duration.ofSeconds(20), event -> isResetPasswordEvent(event)
174174
&& isSuccessfulResetEvent(event)
175175
&& matchesUsernamesIfPresent(event, usernames));
176176
}
@@ -263,7 +263,11 @@ void clearEvents() {
263263
}
264264

265265
KeycloakEvent awaitEvent(Predicate<KeycloakEvent> predicate) {
266-
long deadline = System.currentTimeMillis() + Duration.ofSeconds(5).toMillis();
266+
return awaitEvent(Duration.ofSeconds(5), predicate);
267+
}
268+
269+
KeycloakEvent awaitEvent(Duration timeout, Predicate<KeycloakEvent> predicate) {
270+
long deadline = System.currentTimeMillis() + timeout.toMillis();
267271
while (System.currentTimeMillis() < deadline) {
268272
List<KeycloakEvent> events = events();
269273
for (KeycloakEvent event : events) {

0 commit comments

Comments
 (0)