Skip to content

Commit

Permalink
Flaky test BruteForceTest.testPermanentLockout()
Browse files Browse the repository at this point in the history
Closes keycloak#32498

Signed-off-by: Douglas Palmer <[email protected]>
  • Loading branch information
douglaspalmer authored and ahus1 committed Aug 30, 2024
1 parent ecbd856 commit 0b7ab47
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ public void testPermanentLockout() {
try {
// arrange
realm.setPermanentLockout(true);
realm.setQuickLoginCheckMilliSeconds(0L);
testRealm().update(realm);

// act
Expand All @@ -567,7 +568,7 @@ public void testPermanentLockout() {
// 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<EventRepresentation> actualEvents = Arrays.asList(events.poll(), events.poll(), events.poll());
List<EventRepresentation> 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);

Expand Down

0 comments on commit 0b7ab47

Please sign in to comment.