Skip to content

Commit

Permalink
Calculate and specify a wait-for-it timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipross committed May 16, 2020
1 parent 476094e commit f36c8cf
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import org.arquillian.cube.docker.impl.client.config.Await;
import org.arquillian.cube.docker.impl.docker.DockerClientExecutor;
Expand Down Expand Up @@ -214,7 +215,12 @@ private Set<PosixFilePermission> getScriptPermissions() {
}

private String resolveWaitForItCommand(String containerIp, int port) {
return String.format("%s/%s %s:%s -s -- echo %s", CONTAINER_DIRECTORY, WAIT_FOR_IT_SCRIPT, containerIp, port,
final long waitForItSleepSeconds = TimeUnit.SECONDS.convert(
pollIterations * getSleepTime(),
getTimeUnit()
);
return String.format("%s/%s %s:%s -s -t %s -- echo %s", CONTAINER_DIRECTORY, WAIT_FOR_IT_SCRIPT, containerIp, port,
waitForItSleepSeconds,
MESSAGE);
}

Expand Down

0 comments on commit f36c8cf

Please sign in to comment.