Skip to content
Merged
Changes from all 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 @@ -151,6 +151,7 @@ protected void waitUntilContainerStarted() {
// Repeatedly try and open a connection to the DB and execute a test query
long start = System.currentTimeMillis();

Exception lastConnectionException = null;
while (System.currentTimeMillis() < start + (1000 * startupTimeoutSeconds)) {
if (!isRunning()) {
Thread.sleep(100L);
Expand All @@ -165,6 +166,7 @@ protected void waitUntilContainerStarted() {
// we explicitly want this exception to fail fast without retries
throw e;
} catch (Exception e) {
lastConnectionException = e;
// ignore so that we can try again
logger().debug("Failure when trying test query", e);
Thread.sleep(100L);
Expand All @@ -176,7 +178,8 @@ protected void waitUntilContainerStarted() {
String.format(
"Container is started, but cannot be accessed by (JDBC URL: %s), please check container logs",
this.getJdbcUrl()
)
),
lastConnectionException
);
}

Expand Down