Skip to content

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

Open
michalvavrik wants to merge 1 commit intokeycloak:mainfrom
michalvavrik:feature/skip-bootstrap-in-tests
Open

Quarkus IT execution time savings: skip realm bootstrap when not required#48809
michalvavrik wants to merge 1 commit intokeycloak:mainfrom
michalvavrik:feature/skip-bootstrap-in-tests

Conversation

@michalvavrik
Copy link
Copy Markdown
Member

Class Tests Before After Saved
ClusterConfigDistTest 26 332.1s 316.8s 15.3s
FeaturesDistTest 8 70.6s 65.6s 5.0s
HostnameV2DistTest 6 27.0s 25.5s 1.5s
CacheEmbeddedMtlsDistTest 5 21.4s 21.4s 0.0s

* Closes: keycloak#48808

| Class | Tests | Before | After | Saved |
|---|---|---|---|---|
| ClusterConfigDistTest | 26 | 332.1s | 316.8s | 15.3s |
| TracingDistTest | 19 | 110.0s | 102.0s | 8.0s |
| FeaturesDistTest | 8 | 70.6s | 65.6s | 5.0s |
| HostnameV2DistTest | 6 | 27.0s | 25.5s | 1.5s |
| CacheEmbeddedMtlsDistTest | 5 | 21.4s | 21.4s | 0.0s |
| **Total** | **64** | **561.1s** | **531.3s** | **29.8s** |

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

shawkins commented May 7, 2026

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
Copy link
Copy Markdown
Contributor

shawkins commented May 7, 2026

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
Copy link
Copy Markdown
Contributor

shawkins commented May 7, 2026

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
Copy link
Copy Markdown
Contributor

shawkins commented May 7, 2026

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.

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

2 participants