diff --git a/quarkus/tests/integration/src/main/java/org/keycloak/it/utils/DockerKeycloakDistribution.java b/quarkus/tests/integration/src/main/java/org/keycloak/it/utils/DockerKeycloakDistribution.java index 33e60fe0f1..c05800213f 100644 --- a/quarkus/tests/integration/src/main/java/org/keycloak/it/utils/DockerKeycloakDistribution.java +++ b/quarkus/tests/integration/src/main/java/org/keycloak/it/utils/DockerKeycloakDistribution.java @@ -1,20 +1,15 @@ package org.keycloak.it.utils; import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; import org.jboss.logging.Logger; import org.keycloak.common.Version; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.output.OutputFrame; import org.testcontainers.containers.output.ToStringConsumer; -import org.testcontainers.containers.startupcheck.OneShotStartupCheckStrategy; -import org.testcontainers.containers.wait.strategy.Wait; -import org.testcontainers.containers.wait.strategy.WaitStrategy; import org.testcontainers.images.builder.ImageFromDockerfile; import java.io.File; import java.net.URL; -import java.time.Duration; import java.util.List; public final class DockerKeycloakDistribution implements KeycloakDistribution { @@ -50,10 +45,7 @@ public final class DockerKeycloakDistribution implements KeycloakDistribution { .withFileFromFile("Dockerfile", dockerFile) .withBuildArg("KEYCLOAK_DIST", "keycloakx.tar.gz") ) - .withExposedPorts(8080) - .withStartupTimeout(Duration.ofSeconds(40)) - .withStartupAttempts(1) - .waitingFor(Wait.forHttp("/").forStatusCode(200).withReadTimeout(Duration.ofSeconds(2))); + .withExposedPorts(8080); } public DockerKeycloakDistribution(boolean debug, boolean manualStop, boolean reCreate) { @@ -69,6 +61,7 @@ public final class DockerKeycloakDistribution implements KeycloakDistribution { this.stderr = List.of(); this.backupConsumer = new ToStringConsumer(); + keycloakContainer = runKeycloakContainer(); keycloakContainer @@ -95,12 +88,13 @@ public final class DockerKeycloakDistribution implements KeycloakDistribution { this.stderr = getErrorStream(); keycloakContainer.stop(); - keycloakContainer = null; this.exitCode = 0; } } catch (Exception cause) { this.exitCode = -1; throw new RuntimeException("Failed to stop the server", cause); + } finally { + keycloakContainer = null; } } diff --git a/quarkus/tests/integration/src/test/resources/testcontainers.properties b/quarkus/tests/integration/src/test/resources/testcontainers.properties new file mode 100644 index 0000000000..e69de29bb2