From b17512a8181a4f513a6736aab896feea8714701f Mon Sep 17 00:00:00 2001 From: Jeffrey Douangpaseuth <11084623+Nephery@users.noreply.github.com> Date: Fri, 25 Aug 2023 10:55:12 -0400 Subject: [PATCH] incr startup timeout of Connect containers --- .../it/util/testcontainers/BitnamiKafkaConnectContainer.java | 4 +++- .../util/testcontainers/ConfluentKafkaConnectContainer.java | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/integrationTest/java/com/solace/connector/kafka/connect/sink/it/util/testcontainers/BitnamiKafkaConnectContainer.java b/src/integrationTest/java/com/solace/connector/kafka/connect/sink/it/util/testcontainers/BitnamiKafkaConnectContainer.java index 78cb05a..4770ca1 100644 --- a/src/integrationTest/java/com/solace/connector/kafka/connect/sink/it/util/testcontainers/BitnamiKafkaConnectContainer.java +++ b/src/integrationTest/java/com/solace/connector/kafka/connect/sink/it/util/testcontainers/BitnamiKafkaConnectContainer.java @@ -13,6 +13,7 @@ import org.testcontainers.utility.DockerImageName; import java.nio.charset.StandardCharsets; +import java.time.Duration; import java.util.Comparator; public class BitnamiKafkaConnectContainer extends GenericContainer { @@ -51,7 +52,8 @@ public BitnamiKafkaConnectContainer(DockerImageName dockerImageName) { BROKER_LISTENER_NAME + "://:" + BROKER_LISTENER_PORT, BOOTSTRAP_LISTENER_NAME + "://:" + BOOTSTRAP_LISTENER_PORT)); withClasspathResourceMapping(Tools.getUnzippedConnectorDirName() + "/lib", "/opt/bitnami/kafka/jars/pubsubplus-connector-kafka", BindMode.READ_ONLY); - waitingFor(Wait.forLogMessage(".*Finished starting connectors and tasks.*", 1)); + waitingFor(Wait.forLogMessage(".*Finished starting connectors and tasks.*", 1) + .withStartupTimeout(Duration.ofMinutes(10))); } @Override diff --git a/src/integrationTest/java/com/solace/connector/kafka/connect/sink/it/util/testcontainers/ConfluentKafkaConnectContainer.java b/src/integrationTest/java/com/solace/connector/kafka/connect/sink/it/util/testcontainers/ConfluentKafkaConnectContainer.java index 0bd914b..d42ac7b 100644 --- a/src/integrationTest/java/com/solace/connector/kafka/connect/sink/it/util/testcontainers/ConfluentKafkaConnectContainer.java +++ b/src/integrationTest/java/com/solace/connector/kafka/connect/sink/it/util/testcontainers/ConfluentKafkaConnectContainer.java @@ -10,6 +10,8 @@ import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.utility.DockerImageName; +import java.time.Duration; + import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -63,7 +65,8 @@ public ConfluentKafkaConnectContainer(DockerImageName dockerImageName, withEnv("CONNECT_PLUGIN_PATH", "/usr/share/java,/etc/kafka-connect/jars"); withClasspathResourceMapping(Tools.getUnzippedConnectorDirName() + "/lib", "/etc/kafka-connect/jars", BindMode.READ_ONLY); - waitingFor( Wait.forLogMessage(".*Kafka Connect started.*", 1) ); + waitingFor( Wait.forLogMessage(".*Kafka Connect started.*", 1) + .withStartupTimeout(Duration.ofMinutes(10)) ); } public String getConnectUrl() {