Test framework doesn't stop running Keycloak instance if reuse is turned off

Closes #45750

Signed-off-by: Stian Thorgersen <st@li-fbf8e8cc-23c4-11b2-a85c-be35f7de969a.ibm.com>
Co-authored-by: Stian Thorgersen <st@li-fbf8e8cc-23c4-11b2-a85c-be35f7de969a.ibm.com>
This commit is contained in:
Stian Thorgersen 2026-01-26 18:50:17 +01:00 committed by GitHub
parent 77704a91b6
commit c51e1af941
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -71,12 +71,11 @@ public class DistributionKeycloakServer implements KeycloakServer {
List<String> args = keycloakServerConfigBuilder.toArgs();
Set<Dependency> dependencies = keycloakServerConfigBuilder.toDependencies();
if (!reuse) {
killPreviousProcess();
}
try {
boolean installationCreated = createInstallation();
if (!reuse) {
killPreviousProcess();
}
File providersDir = new File(keycloakHomeDir, "providers");
List<File> existingProviders = listExistingProviders(providersDir);
@ -426,13 +425,17 @@ public class DistributionKeycloakServer implements KeycloakServer {
}
} catch (IOException e) {
// Ignored
} finally {
if (startupLatch.getCount() != 0) {
startupLatch.countDown();
}
}
}
public boolean waitForStarted() {
try {
startupLatch.await(startTimeout, TimeUnit.SECONDS);
return true;
return process.isAlive();
} catch (InterruptedException e) {
return false;
}