Skip to content

Commit

Permalink
Extend pull/startup timeout for Oracle container
Browse files Browse the repository at this point in the history
  • Loading branch information
rnorth committed Mar 13, 2018
1 parent fb9f969 commit 8261c01
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.testcontainers.containers;

import java.util.concurrent.Future;
import lombok.NonNull;
import org.jetbrains.annotations.NotNull;
import org.rnorth.ducttape.ratelimits.RateLimiter;
Expand All @@ -15,6 +14,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

/**
Expand Down Expand Up @@ -91,7 +91,7 @@ protected void waitUntilContainerStarted() {
// Repeatedly try and open a connection to the DB and execute a test query

logger().info("Waiting for database connection to become available at {} using query '{}'", getJdbcUrl(), getTestQueryString());
Unreliables.retryUntilSuccess(120, TimeUnit.SECONDS, () -> {
Unreliables.retryUntilSuccess(getStartupTimeoutSeconds(), TimeUnit.SECONDS, () -> {

if (!isRunning()) {
throw new ContainerLaunchException("Container failed to start");
Expand Down Expand Up @@ -185,4 +185,11 @@ public void setParameters(Map<String, String> parameters) {
public void addParameter(String paramName, String value) {
this.parameters.put(paramName, value);
}

/**
* @return startup time to allow, including image pull time, in seconds
*/
protected int getStartupTimeoutSeconds() {
return 120;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,9 @@ public Integer getWebPort() {
public String getTestQueryString() {
return "SELECT 1 FROM DUAL";
}

@Override
protected int getStartupTimeoutSeconds() {
return 240;
}
}

0 comments on commit 8261c01

Please sign in to comment.