Skip to content

Commit

Permalink
Increase timeout for ES startup checks on Docker (#53680)
Browse files Browse the repository at this point in the history
We're seeing some timeout failures on certain DockerTests in the qa/os
project. This commit changes the 7.6 branch to match what's on 7.7 and
master.
  • Loading branch information
williamrandolph committed Mar 18, 2020
1 parent 8c736bd commit d26a3c5
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public class Docker {

private static final Shell sh = new Shell();
private static final DockerShell dockerShell = new DockerShell();
public static final int STARTUP_SLEEP_INTERVAL_MILLISECONDS = 1000;
public static final int STARTUP_ATTEMPTS_MAX = 10;

/**
* Tracks the currently running Docker image. An earlier implementation used a fixed container name,
Expand Down Expand Up @@ -178,7 +180,7 @@ public static void waitForElasticsearchToStart() {
do {
try {
// Give the container a chance to crash out
Thread.sleep(1000);
Thread.sleep(STARTUP_SLEEP_INTERVAL_MILLISECONDS);

psOutput = dockerShell.run("ps -ww ax").stdout;

Expand All @@ -189,7 +191,7 @@ public static void waitForElasticsearchToStart() {
} catch (Exception e) {
logger.warn("Caught exception while waiting for ES to start", e);
}
} while (attempt++ < 5);
} while (attempt++ < STARTUP_ATTEMPTS_MAX);

if (isElasticsearchRunning == false) {
final Shell.Result dockerLogs = getContainerLogs();
Expand Down

0 comments on commit d26a3c5

Please sign in to comment.