diff --git a/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-common/src/main/java/org/kie/kogito/test/resources/CompositeTestResource.java b/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-common/src/main/java/org/kie/kogito/test/resources/CompositeTestResource.java index a8da66f8ee..802896bb4b 100644 --- a/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-common/src/main/java/org/kie/kogito/test/resources/CompositeTestResource.java +++ b/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-common/src/main/java/org/kie/kogito/test/resources/CompositeTestResource.java @@ -29,6 +29,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import org.kie.kogito.testcontainers.Constants; import org.kie.kogito.testcontainers.KogitoGenericContainer; import org.kie.kogito.testcontainers.KogitoKafkaContainer; import org.kie.kogito.testcontainers.KogitoPostgreSqlContainer; @@ -94,7 +95,7 @@ public void start() { final Network network = Network.newNetwork(); sharedDependencyContainers.values().stream() .map(c -> c.withNetwork(network)) - .map(c -> c.waitingFor(Wait.forListeningPort())) + .map(c -> c.waitingFor(Wait.forListeningPort()).withStartupTimeout(Constants.CONTAINER_START_TIMEOUT)) .forEach(GenericContainer::start); configureKafkaToService(sharedDependencyContainers.values(), serviceContainers.values().toArray(GenericContainer[]::new)); startServices(network); diff --git a/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-common/src/main/java/org/kie/kogito/testcontainers/JobServiceContainer.java b/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-common/src/main/java/org/kie/kogito/testcontainers/JobServiceContainer.java index 3d6d2521b9..9781a04b47 100644 --- a/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-common/src/main/java/org/kie/kogito/testcontainers/JobServiceContainer.java +++ b/apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-common/src/main/java/org/kie/kogito/testcontainers/JobServiceContainer.java @@ -29,7 +29,7 @@ public class JobServiceContainer extends KogitoGenericContainer settings = new HashMap<>(); settings.put(Environment.URL, postgresql.getJdbcUrl()); diff --git a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/containers/AbstractDataIndexContainer.java b/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/containers/AbstractDataIndexContainer.java index efb814723c..dc9a34cc71 100644 --- a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/containers/AbstractDataIndexContainer.java +++ b/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/containers/AbstractDataIndexContainer.java @@ -26,6 +26,7 @@ import java.nio.file.Paths; import org.kie.kogito.test.resources.TestResource; +import org.kie.kogito.testcontainers.Constants; import org.kie.kogito.testcontainers.KogitoGenericContainer; import org.testcontainers.containers.BindMode; import org.testcontainers.containers.wait.strategy.Wait; @@ -41,7 +42,7 @@ public abstract class AbstractDataIndexContainer extends KogitoGenericContainer< public AbstractDataIndexContainer(String containerName) { super(containerName); addExposedPort(PORT); - waitingFor(Wait.forListeningPort()); + waitingFor(Wait.forListeningPort()).withStartupTimeout(Constants.CONTAINER_START_TIMEOUT); addEnv("KOGITO_PROTOBUF_FOLDER", "/home/kogito/data/protobufs/"); withAccessToHost(true); } diff --git a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/http/DataIndexPostgreSqlHttpResource.java b/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/http/DataIndexPostgreSqlHttpResource.java index eae92ef59f..a0483a101a 100644 --- a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/http/DataIndexPostgreSqlHttpResource.java +++ b/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/http/DataIndexPostgreSqlHttpResource.java @@ -20,6 +20,7 @@ import org.kie.kogito.index.test.containers.DataIndexPostgreSqlContainer; import org.kie.kogito.test.resources.TestResource; +import org.kie.kogito.testcontainers.Constants; import org.kie.kogito.testcontainers.KogitoPostgreSqlContainer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -44,7 +45,7 @@ public void start() { Network network = Network.newNetwork(); postgresql.withNetwork(network); postgresql.withNetworkAliases("postgresql"); - postgresql.waitingFor(Wait.forListeningPort()); + postgresql.waitingFor(Wait.forListeningPort()).withStartupTimeout(Constants.CONTAINER_START_TIMEOUT); postgresql.start(); dataIndex.addProtoFileFolder(); diff --git a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/kafka/DataIndexOracleKafkaResource.java b/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/kafka/DataIndexOracleKafkaResource.java index 6a589b4470..968ad34f5e 100644 --- a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/kafka/DataIndexOracleKafkaResource.java +++ b/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/kafka/DataIndexOracleKafkaResource.java @@ -24,6 +24,7 @@ import org.kie.kogito.index.test.containers.DataIndexOracleContainer; import org.kie.kogito.index.test.containers.KogitoKafkaContainerWithoutBridge; import org.kie.kogito.test.resources.TestResource; +import org.kie.kogito.testcontainers.Constants; import org.kie.kogito.testcontainers.KogitoOracleSqlContainer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -56,7 +57,7 @@ public void start() { oracle.start(); kafka.withNetwork(network); kafka.withNetworkAliases("kafka"); - kafka.waitingFor(Wait.forListeningPort()); + kafka.waitingFor(Wait.forListeningPort()).withStartupTimeout(Constants.CONTAINER_START_TIMEOUT); kafka.start(); String kafkaURL = kafka.getBootstrapServers(); properties.put("kafka.bootstrap.servers", kafkaURL); diff --git a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/kafka/DataIndexPostgreSqlKafkaResource.java b/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/kafka/DataIndexPostgreSqlKafkaResource.java index 760dfda020..cf9caf6d82 100644 --- a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/kafka/DataIndexPostgreSqlKafkaResource.java +++ b/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/kafka/DataIndexPostgreSqlKafkaResource.java @@ -24,6 +24,7 @@ import org.kie.kogito.index.test.containers.DataIndexPostgreSqlContainer; import org.kie.kogito.index.test.containers.KogitoKafkaContainerWithoutBridge; import org.kie.kogito.test.resources.TestResource; +import org.kie.kogito.testcontainers.Constants; import org.kie.kogito.testcontainers.KogitoPostgreSqlContainer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -51,11 +52,11 @@ public void start() { Network network = Network.newNetwork(); postgresql.withNetwork(network); postgresql.withNetworkAliases("postgresql"); - postgresql.waitingFor(Wait.forListeningPort()); + postgresql.waitingFor(Wait.forListeningPort()).withStartupTimeout(Constants.CONTAINER_START_TIMEOUT); postgresql.start(); kafka.withNetwork(network); kafka.withNetworkAliases("kafka"); - kafka.waitingFor(Wait.forListeningPort()); + kafka.waitingFor(Wait.forListeningPort()).withStartupTimeout(Constants.CONTAINER_START_TIMEOUT); kafka.start(); String kafkaURL = kafka.getBootstrapServers(); properties.put("kafka.bootstrap.servers", kafkaURL); diff --git a/persistence-commons/persistence-commons-oracle/src/test/java/org/kie/kogito/persistence/schema/DDLSchemaExporter.java b/persistence-commons/persistence-commons-oracle/src/test/java/org/kie/kogito/persistence/schema/DDLSchemaExporter.java index 9269c56b94..ca2b0d05ec 100644 --- a/persistence-commons/persistence-commons-oracle/src/test/java/org/kie/kogito/persistence/schema/DDLSchemaExporter.java +++ b/persistence-commons/persistence-commons-oracle/src/test/java/org/kie/kogito/persistence/schema/DDLSchemaExporter.java @@ -30,6 +30,7 @@ import org.hibernate.tool.hbm2ddl.SchemaExport; import org.hibernate.tool.schema.TargetType; import org.kie.kogito.persistence.oracle.model.CacheEntity; +import org.kie.kogito.testcontainers.Constants; import org.kie.kogito.testcontainers.KogitoOracleSqlContainer; import org.testcontainers.containers.wait.strategy.Wait; @@ -37,7 +38,7 @@ public class DDLSchemaExporter { public static void main(String[] args) { try (KogitoOracleSqlContainer oracle = new KogitoOracleSqlContainer()) { - oracle.waitingFor(Wait.forListeningPort()); + oracle.waitingFor(Wait.forListeningPort()).withStartupTimeout(Constants.CONTAINER_START_TIMEOUT); oracle.start(); Map settings = new HashMap<>(); settings.put(Environment.URL, oracle.getJdbcUrl()); diff --git a/persistence-commons/persistence-commons-postgresql/src/test/java/org/kie/kogito/persistence/schema/DDLSchemaExporter.java b/persistence-commons/persistence-commons-postgresql/src/test/java/org/kie/kogito/persistence/schema/DDLSchemaExporter.java index 2d8e5734f5..17e883c8ab 100644 --- a/persistence-commons/persistence-commons-postgresql/src/test/java/org/kie/kogito/persistence/schema/DDLSchemaExporter.java +++ b/persistence-commons/persistence-commons-postgresql/src/test/java/org/kie/kogito/persistence/schema/DDLSchemaExporter.java @@ -30,6 +30,7 @@ import org.hibernate.tool.hbm2ddl.SchemaExport; import org.hibernate.tool.schema.TargetType; import org.kie.kogito.persistence.postgresql.model.CacheEntity; +import org.kie.kogito.testcontainers.Constants; import org.kie.kogito.testcontainers.KogitoPostgreSqlContainer; import org.testcontainers.containers.wait.strategy.Wait; @@ -37,7 +38,7 @@ public class DDLSchemaExporter { public static void main(String[] args) { try (KogitoPostgreSqlContainer postgresql = new KogitoPostgreSqlContainer()) { - postgresql.waitingFor(Wait.forListeningPort()); + postgresql.waitingFor(Wait.forListeningPort()).withStartupTimeout(Constants.CONTAINER_START_TIMEOUT); postgresql.start(); Map settings = new HashMap<>(); settings.put(Environment.URL, postgresql.getJdbcUrl());