From 0b7ab47cf2fcedffd88cccde06189de2d98d724c Mon Sep 17 00:00:00 2001 From: Douglas Palmer Date: Thu, 29 Aug 2024 14:32:44 -0700 Subject: [PATCH] Flaky test BruteForceTest.testPermanentLockout() Closes #32498 Signed-off-by: Douglas Palmer --- .../test/java/org/keycloak/testsuite/forms/BruteForceTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/BruteForceTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/BruteForceTest.java index 640265294f..9110cf67ae 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/BruteForceTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/BruteForceTest.java @@ -558,6 +558,7 @@ public class BruteForceTest extends AbstractTestRealmKeycloakTest { try { // arrange realm.setPermanentLockout(true); + realm.setQuickLoginCheckMilliSeconds(0L); testRealm().update(realm); // act @@ -567,7 +568,7 @@ public class BruteForceTest extends AbstractTestRealmKeycloakTest { // As of now, there are two events: USER_DISABLED_BY_PERMANENT_LOCKOUT and LOGIN_ERROR but Order is not // guarantee though since the brute force detector is running separately "in its own thread" named // "Brute Force Protector". - List actualEvents = Arrays.asList(events.poll(), events.poll(), events.poll()); + List actualEvents = Arrays.asList(events.poll(), events.poll()); assertIsContained(events.expect(EventType.USER_DISABLED_BY_PERMANENT_LOCKOUT).client((String) null).detail(Details.REASON, "brute_force_attack detected"), actualEvents); assertIsContained(events.expect(EventType.LOGIN_ERROR).error(Errors.INVALID_USER_CREDENTIALS), actualEvents);