Skip to content

Commit

Permalink
[mongodb] [tests] Loosen E2E timeout limitations
Browse files Browse the repository at this point in the history
 This closes #2334.

(cherry picked from commit 883b684)
  • Loading branch information
yuxiqian authored and leonardBang committed Oct 31, 2023
1 parent 0ff6e26 commit 30e9761
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ public void before() {
new MongoDBContainer(NETWORK, MongoDBContainer.ShardingClusterRole.ROUTER)
.dependsOn(shard)
.withNetworkAliases(INTER_CONTAINER_MONGO_ALIAS)
.withLogConsumer(new Slf4jLogConsumer(LOG));
.withLogConsumer(new Slf4jLogConsumer(LOG))
.withStartupTimeout(Duration.ofSeconds(120));

Startables.deepStart(Stream.of(config)).join();
Startables.deepStart(Stream.of(shard)).join();
Expand Down Expand Up @@ -237,7 +238,7 @@ public void testMongoDbCDC() throws Exception {
expectResult,
"mongodb_products_sink",
new String[] {"id", "name", "description", "weight"},
60000L);
150000L);
}

private Document productDocOf(String id, String name, String description, Double weight) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.time.Duration;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -101,6 +102,11 @@ public String getHostAndPort() {
return String.format("%s:%s", getContainerIpAddress(), getMappedPort(MONGODB_PORT));
}

@Override
public MongoDBContainer withStartupTimeout(Duration timeout) {
return (MongoDBContainer) super.withStartupTimeout(timeout);
}

public void executeCommand(String command) {
try {
LOG.info("Executing mongo command: {}", command);
Expand Down

0 comments on commit 30e9761

Please sign in to comment.