Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OrientDB: Use log wait strategy for more reliable readiness detection #4471

Merged
merged 6 commits into from
Oct 11, 2021
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.containers.wait.strategy.HttpWaitStrategy;
import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.containers.wait.strategy.WaitAllStrategy;
import org.testcontainers.containers.wait.strategy.WaitStrategy;
Expand Down Expand Up @@ -68,12 +69,15 @@ public OrientDBContainer(final DockerImageName dockerImageName) {
serverPassword = DEFAULT_SERVER_PASSWORD;
databaseName = DEFAULT_DATABASE_NAME;

LogMessageWaitStrategy waitForLogs = new LogMessageWaitStrategy()
.withRegEx(".*Gremlin started correctly.*");

WaitStrategy waitForHttp = new HttpWaitStrategy()
.forPort(DEFAULT_HTTP_PORT)
.forStatusCodeMatching(response -> response == HTTP_OK);

waitStrategy = new WaitAllStrategy()
.withStrategy(Wait.forListeningPort())
.withStrategy(waitForLogs)
.withStrategy(waitForHttp)
kiview marked this conversation as resolved.
Show resolved Hide resolved
.withStartupTimeout(Duration.ofMinutes(2));

Expand Down