Closed behrangs-sportsbet closed 6 years ago
AFAIK you have to switch the order of the withStartupTimeout()
and waitingFor()
method invocations or call withStartupTimeout()
directly on your WaitStrategy
object.
The reason is withStartupTimeout()
on GenericContainer
delegates to the currently set WaitStrategy
,
Thanks. Changed it to:
@ClassRule
public static GenericContainer INFORMIX_RULE =
new GenericContainer(INFORMIX_IMAGE_NAME).withExposedPorts(INFORMIX_TCP_PORT)
.withEnv("LICENSE", "accept")
.withPrivilegedMode(true)
.waitingFor(new WaitAllStrategy().withStrategy(new LogMessageWaitStrategy().withRegEx(".*Startup of dev SUCCESS.*\n"))
.withStrategy(new HostPortWaitStrategy())
.withStartupTimeout(Duration.ofMinutes(2)));
and it is now working.
OS: OS X 10.11.6 Docker: Docker for Mac version 18.03.0-ce, build 0520e24 Test Containers Version: 1.6.0
Test code:
Error (occurs much faster than 5 minutes)