Skip to content

Commit

Permalink
incr startup timeout of Connect containers
Browse files Browse the repository at this point in the history
  • Loading branch information
Nephery committed Aug 25, 2023
1 parent 70af5e6 commit b17512a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<BitnamiKafkaConnectContainer> {
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit b17512a

Please sign in to comment.