8000 Quarkus IT execution time savings: skip realm bootstrap when not required by michalvavrik · Pull Request #48809 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Quarkus IT execution time savings: skip realm bootstrap when not required - #48809

Merged
vmuzikar merged 1 commit into
keycloak:mainfrom
michalvavrik:feature/skip-bootstrap-in-tests
May 12, 2026
Merged

vmuzikar merged 1 commit into
keycloak:mainfrom
michalvavrik:feature/skip-bootstrap-in-tests

Conversation

@michalvavrik
@michalvavrik michalvavrik commented May 7, 2026 •
Copy link
Copy Markdown
Member
Class Tests Before After Saved
ClusterConfigDistTest 26 160.7s 126.9s 33.8s
TracingDistTest 19 88.4s 71.5s 16.9s
FeaturesDistTest 8 53.9s 47.6s 6.3s
CacheEmbeddedMtlsDistTest 5 27.4s 25.4s 2.0s
HostnameV2DistTest 6 22.6s 21.8s 0.8s
Total 64 352.9s 293.2s 59.7s

@shawkins
shawkins commented May 7, 2026
Copy link
Copy Markdown
Contributor

Highly related to the mechanism to inhibit the full startup in #48759 - we'll eventually need to share the approach.

@michalvavrik
Copy link
Copy Markdown
Member Author

Highly related to the mechanism to inhibit the full startup in #48759 - we'll eventually need to share the approach.

I may be wrong about this, but I think they are complementary. The one improvement by #48759 would be that if we have initialized db, we won't need liquidbase migrations which I couldn't skip here because it broke so many things. I suppose it will be possible with your PR even without this one anyway (as migrations are already done).

This has really small effect, but as I spend so much time, I decided to submit it. Either we want this PR or not, fine with me either way.

@shawkins
shawkins commented May 7, 2026
Copy link
Copy Markdown
Contributor

I may be wrong about this, but I think they are complementary.

That's exactly what I mean. There will need to be a single mechanism for inhibiting the full start of the server - it's being done in exactly the same spot (after factory postInit, but before bootstrapping), for different reasons.

@shawkins
shawkins commented May 7, 2026
Copy link
Copy Markdown
Contributor

In order of presedence, you can change the startup of keycloak with:

  • KC_DRY_RUN=true
  • the mechanism here and in the other pr
  • kc.launch.mode=test

It may be worthing thinking about collapsing this in some way:

KC_LAUNCH_MODE=test|dry_run|skip_bootstrap

If we made the name move evocative it would instead be

KC_LAUNCH_MODE=exit_after_start|exit_before_quarkus|exit_before_bootstrap

@michalvavrik
Copy link
Copy Markdown
Member Author

KC_LAUNCH_MODE=exit_after_start|exit_before_quarkus|exit_before_bootstrap

this is easier for me to understand

@shawkins
shawkins commented May 7, 2026
Copy link
Copy Markdown
Contributor

this is easier for me to understand

Right, it can be initially confusing what "test" means - especially since it's set implicitly in a couple of places.

@michalvavrik
michalvavrik force-pushed the feature/skip-bootstrap-in-tests branch from 0ddb026 to fc5713e Compare May 11, 2026 14:56
@michalvavrik
michalvavrik commented May 11, 2026 •
Copy link
Copy Markdown
Member Author

this is easier for me to understand

Right, it can be initially confusing what "test" means - especially since it's set implicitly in a couple of places.

I started looking into refactoring of launch modes, but it felt like too many changes that are not directly related for such a PR. So I introduced 2 launch modes (one for my env var and one for yours). Is that enough? I'll measure times before/after this PR and update the PR description in 30 mins.

@michalvavrik
Copy link
Copy Markdown
Member Author

Updated, this PR saves roughly one minute. We could explore skipping liquidbase, but I didn't look if it is not skipped already when it detects pre-initialized DB. I won't invest more into it in this PR.

@michalvavrik
michalvavrik force-pushed the feature/skip-bootstrap-in-tests branch 2 times, most recently from ab217c9 to 0c19d5f Compare May 11, 2026 15:56
@michalvavrik
Copy link
Copy Markdown
Member Author

I keep rebasing but it is hard to get a green CI for completely unrelated failures, I'll just let this one finish and accept results.

@michalvavrik
michalvavrik force-pushed the feature/skip-bootstrap-in-tests branch 3 times, most recently from 4e3a8cd to 27d4a87 Compare May 11, 2026 20:50
* Closes: keycloak#48808

Signed-off-by: Michal Vavřík <michal.vavrik@aol.com>
@shawkins shawkins left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, I'll align more with the dryrun logic in a follow-up.

@michalvavrik
Copy link
Copy Markdown
Member Author

LGTM, I'll align more with the dryrun logic in a follow-up.

sound good; @vmuzikar do you want to review?

@vmuzikar
vmuzikar merged commit 9a4111b into keycloak:main May 12, 2026
89 checks passed
@michalvavrik
michalvavrik deleted the feature/skip-bootstrap-in-tests branch May 12, 2026 14:58
@stianst stianst mentioned this pull request Jun 1, 2026
sashyo pushed a commit to tide-foundation/keycloak-IGA that referenced this pull request Jul 20, 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.

Improve Quarkus integration tests execution time by skipping realm bootstrap when not required

3 participants

0