Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: refining how the junit Keycloak is launched#46182

Merged
vmuzikar merged 1 commit intokeycloak:mainfrom
shawkins:iss46160
Feb 11, 2026
Merged

fix: refining how the junit Keycloak is launched#46182
vmuzikar merged 1 commit intokeycloak:mainfrom
shawkins:iss46160

Conversation

@shawkins
Copy link
Contributor

@shawkins shawkins commented Feb 10, 2026

closes: #46160

Turns out the problem wasn't with asyncExit, it was more of an issue with initSys. To prevent it from causing the start to hang and / or produce duplicate results we need to only let it have an effect for auto build commands and require it to return the built exit code.

The change to the QuarkusKeycloakSessionFactory is to address that some failed launches, such as when the hostname provider fails validation, will leave provider factories as not being cleaned up - for example BasicTimerProviderFactory starts a non-daemon thread.

Limited the additional fix to just BasicTimerProviderFactory - the factory logic seems pretty fragile in terms of when close can be called - some expect postInit to have been called, while other it's just after init.

Copy link
Member

@michalvavrik michalvavrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Judging by the context around modified methods and in org.keycloak.quarkus.runtime.cli.command.AbstractAutoBuildCommand, I think this change is correct. But you will need review from someone with wider context. Thanks for the fix.

@shawkins shawkins force-pushed the iss46160 branch 2 times, most recently from a7473c5 to fcdbac1 Compare February 10, 2026 18:04
Copy link
Contributor

@mabartos mabartos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I can confirm it resolves the issue.

@shawkins
Copy link
Contributor Author

LGTM.

I can confirm it resolves the issue.

Thanks @mabartos for confirmation.

Captured #46238 as a follow-up to this.

Copy link
Contributor

@vmuzikar vmuzikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving based on @mabartos' and @michalvavrik's reviews.

@vmuzikar vmuzikar merged commit 27fb8fa into keycloak:main Feb 11, 2026
138 of 140 checks passed
msdaly200 pushed a commit to msdaly200/keycloak that referenced this pull request Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keycloak from quarkus/tests/junit5 doesn't throw exception when there's a startup failure

4 participants