You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use cleanup methods provided by framework - #53876
ManagedRealm.updateClientWithCleanup now restores added client attributes with an empty value, as a client update only merges attributes. Without this, attributes such as client.session.max.lifespan stayed on the shared test-app client and broke later tests.
The user notBefore set by user.admin().logout() can't be reset through a user update, so RefreshTokenTest marks the user as dirty to have it re-created. The test sets notBefore to the real time before applying a positive offset, so the leftover value would be harmless to other tests. The dirty marker is for hygiene only.
Tests that need the time offset in the Infinispan caches use @InjectTimeOffSet(enableForCaches = true) instead of calling InfinispanTimeUtil manually. The offset reset after each test also disables it again.
Resetting the offset with enableForCaches = true no longer fails if the cache time service was never enabled. The time offset endpoint now uses InfinispanTimeUtil.disableTestingTimeServiceIfEnabled, as set(0) on a fresh state previously threw an IllegalStateException on the server. The strict disableTestingTimeService stays for the model tests, where an unbalanced enable/disable should still fail.
If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.
org.jboss.arquillian.graphene.enricher.exception.PageObjectInitializationException:
Can not instantiate Page Object
class org.keycloak.testsuite.adapter.page.SalesPostClockSkewServlet
declared in:
org.keycloak.testsuite.adapter.servlet.SAMLClockSkewAdapterTest
...
These signatures do not exist: ManagedRealm.updateClientProfile and updateClientPolicy each accept a list of representations, not (name, update). Document the callable signatures so readers can use these helpers without compilation errors.
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lhanusov, good catch. Switched OfflineTokenRefreshTest and OfflineTokenSessionManagementTest to @InjectTimeOffSet(enableForCaches = true) and removed all manual InfinispanTimeUtil enable/disable calls. I checked the PR diff for further additions, and there are none. I also added a short note to BEST_PRACTICES.md.
Relates to keycloak#53874
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Two tests reset the cache time service before initialization, triggering server-side IllegalStateException errors that break class setup and prevent refresh assertions from running.
Relates to keycloak#53874
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #53874
Decisions and assumptions:
ManagedRealm.updateClientWithCleanupnow restores added client attributes with an empty value, as a client update only merges attributes. Without this, attributes such asclient.session.max.lifespanstayed on the sharedtest-appclient and broke later tests.notBeforeset byuser.admin().logout()can't be reset through a user update, soRefreshTokenTestmarks the user as dirty to have it re-created. The test setsnotBeforeto the real time before applying a positive offset, so the leftover value would be harmless to other tests. The dirty marker is for hygiene only.@InjectTimeOffSet(enableForCaches = true)instead of callingInfinispanTimeUtilmanually. The offset reset after each test also disables it again.enableForCaches = trueno longer fails if the cache time service was never enabled. The time offset endpoint now usesInfinispanTimeUtil.disableTestingTimeServiceIfEnabled, asset(0)on a fresh state previously threw anIllegalStateExceptionon the server. The strictdisableTestingTimeServicestays for the model tests, where an unbalanced enable/disable should still fail.timeOffSet.set(0)calls remain, as they are part of the test logic.