testcontainers / testcontainers-java

Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
https://testcontainers.org
MIT License
7.97k stars 1.64k forks source link

Timeout when using the LogMessageWaitStrategy #625

Closed behrangs-sportsbet closed 6 years ago

behrangs-sportsbet commented 6 years ago

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:

import org.junit.ClassRule;
import org.junit.Test;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.HostPortWaitStrategy;
import org.testcontainers.containers.wait.LogMessageWaitStrategy;
import org.testcontainers.containers.wait.WaitAllStrategy;

import java.time.Duration;

public class AdapterIntegrationTest {

    protected static final String INFORMIX_IMAGE_NAME = "ibmcom/informix-innovator-c:latest";

    protected static final int INFORMIX_TCP_PORT = 9088;

    @ClassRule
    public static GenericContainer INFORMIX_RULE =
            new GenericContainer(INFORMIX_IMAGE_NAME).withExposedPorts(INFORMIX_TCP_PORT)
                                                     .withEnv("LICENSE", "accept")
                                                     .withPrivilegedMode(true)
                                                     .withStartupTimeout(Duration.ofMinutes(5))
                                                     .waitingFor(new WaitAllStrategy().withStrategy(new LogMessageWaitStrategy().withRegEx(".*Startup of dev SUCCESS.*"))
                                                                                      .withStrategy(new HostPortWaitStrategy()));

    @Test
    public void testSomething() {
    }
}

Error (occurs much faster than 5 minutes)

/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/bin/java -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:/Users/grey.behrangs/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-1/181.4203.519/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=53511:/Users/grey.behrangs/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-1/181.4203.519/IntelliJ IDEA.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Users/grey.behrangs/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-1/181.4203.519/IntelliJ IDEA.app/Contents/lib/idea_rt.jar:/Users/grey.behrangs/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-1/181.4203.519/IntelliJ IDEA.app/Contents/plugins/junit/lib/junit-rt.jar:/Users/grey.behrangs/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-1/181.4203.519/IntelliJ IDEA.app/Contents/plugins/junit/lib/junit5-rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/lib/tools.jar:/Users/grey.behrangs/Documents/Projects/cdc-cdp/adapter/out/test/classes:/Users/grey.behrangs/Documents/Projects/cdc-cdp/adapter/out/test/resources:/Users/grey.behrangs/Documents/Projects/cdc-cdp/adapter/out/production/classes:/Users/grey.behrangs/Documents/Projects/cdc-cdp/adapter/out/production/resources:/Users/grey.behrangs/Documents/Projects/cdc-cdp/adapter/lib/ifxjdbc.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/19.0/6ce200f6b23222af3d8abb6b6459e6c44f4bb0e9/guava-19.0.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot/1.3.1.RELEASE/7ea554d1d14e180ee080abc3e7c19e316a700188/spring-boot-1.3.1.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-xml/9.2.14.v20151106/946a5a1d4fb816fd346dba74d09a6c0e162cafcd/jetty-xml-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-autoconfigure/1.3.1.RELEASE/16ecb1f0b3ccbc8ecd52fa9de57a273d5a3eea00/spring-boot-autoconfigure-1.3.1.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-servlet/9.2.14.v20151106/3a2cd4d8351a38c5d60e0eee010fee11d87483ef/jetty-servlet-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-log4j2/1.3.1.RELEASE/1cbec222ddd12b17eb073db72f13df959a3c4ea5/spring-boot-starter-log4j2-1.3.1.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-actuator/1.3.1.RELEASE/7671f6c69cf25a513b555ddb4ffab64a9b1fc194/spring-boot-starter-actuator-1.3.1.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty.websocket/websocket-common/9.2.14.v20151106/82661eff627ec55ddde2dd1b461d1a759c3e8f74/websocket-common-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-aop/1.3.1.RELEASE/898d3fe97caf7dd88b42357e1643318753b0cf4e/spring-boot-starter-aop-1.3.1.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-web/1.3.1.RELEASE/dd3c0e6cdee57e591eabc95a33b16233547eec91/spring-boot-starter-web-1.3.1.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-jetty/1.3.1.RELEASE/be814398fcd97f7047249928284f6a021cb7fc/spring-boot-starter-jetty-1.3.1.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-jdbc/1.3.1.RELEASE/6fdd3124a3aa9eaa4d4ac0adde03c734676e40bd/spring-boot-starter-jdbc-1.3.1.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/com.ryantenney.metrics/metrics-spring/3.1.3/9fb02eb930dbe1778b015924770ac853cd7b832e/metrics-spring-3.1.3.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/io.dropwizard.metrics/metrics-core/3.1.2/224f03afd2521c6c94632f566beb1bb5ee32cf07/metrics-core-3.1.2.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/io.dropwizard.metrics/metrics-annotation/3.1.2/7ee8e9afe8e15f921a3bc9f8d4b1109b58b63d46/metrics-annotation-3.1.2.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/io.dropwizard.metrics/metrics-healthchecks/3.1.2/e32a01aa7ca4070676e22e707272422baa0f7ecd/metrics-healthchecks-3.1.2.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty.websocket/websocket-client/9.2.14.v20151106/d2b96eb14d2d033a4ea629a920d7fa0c2d767c89/websocket-client-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.7.3/1499b854ae9f370409792db5af1b552dc7d9682f/jackson-core-2.7.3.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.7.3/f12e6cd05cbaecd74d16e685d45b627732939e42/jackson-databind-2.7.3.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.7.3/e250c11c1329c7b6b62442a9743befad78be553c/jackson-annotations-2.7.3.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.6.2/f1bc476cc167b18e66c297df599b2377131a8947/gson-2.6.2.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/com.rabbitmq/amqp-client/3.6.1/89be4acfa8a0fa48a775a82d20632f90aecf10b/amqp-client-3.6.1.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/au.com.sportsbet.feeds.routes/routes/0.4-SNAPSHOT/de774f095447be7ef74b3872f0eb7016c646c59e/routes-0.4-SNAPSHOT.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/commons-io/commons-io/2.6/815893df5f31da2ece4040fe0a12fd44b577afaf/commons-io-2.6.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.4/5fe28b9518e58819180a43a850fbc0dd24b7c050/commons-lang3-3.4.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty.websocket/websocket-servlet/9.2.14.v20151106/5b133bd555bd8d4e4299eba4d91d24473f67d826/websocket-servlet-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.testcontainers/testcontainers/1.6.0/dabcc223cdebd5f03ca6c9b53679f918b62c6d63/testcontainers-1.6.0.jar:/Users/grey.behrangs/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.spockframework/spock-core/1.0-groovy-2.4/ceaa8b69f274ed3de24da3e6a6c86f673b426d1a/spock-core-1.0-groovy-2.4.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.spockframework/spock-spring/1.0-groovy-2.4/a07c753a95114872cd753ce3ae9166b64284b31d/spock-spring-1.0-groovy-2.4.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-all/2.4.6/478feadca929a946b2f1fb962bb2179264759821/groovy-all-2.4.6.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-test/1.2.4.RELEASE/85cbab1f55a6c47fc11ac149895b0372a8a07c72/spring-boot-starter-test-1.2.4.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework/spring-core/4.2.4.RELEASE/160ccd89230753d4f49477a967f5876b034d9745/spring-core-4.2.4.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-annotations/9.2.14.v20151106/bb7030e5d13eaf9023f38e297c8b2fcae4f8be9b/jetty-annotations-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/cglib/cglib-nodep/3.1/aa83efbd1aedc4f26bdf00e7ea78191483f2c9b3/cglib-nodep-3.1.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty.websocket/javax-websocket-client-impl/9.2.14.v20151106/720e5e620d4b5ed48780eef455acfc6f9bdd6a1b/javax-websocket-client-impl-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/javax.websocket/javax.websocket-api/1.0/fc843b649d4a1dcb0497669d262befa3918c7ba8/javax.websocket-api-1.0.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.apache.tomcat/tomcat-juli/8.0.30/48258c438c681d1322ccb15f01d58238d14c1274/tomcat-juli-8.0.30.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework/spring-tx/4.2.4.RELEASE/66e1a131263f5f9ba95943061b22ff2666930ca6/spring-tx-4.2.4.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.objenesis/objenesis/2.1/87c0ea803b69252868d09308b4618f766f135a96/objenesis-2.1.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/javax.validation/validation-api/1.1.0.Final/8613ae82954779d518631e05daa73a6a954817d5/validation-api-1.1.0.Final.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.jboss.logging/jboss-logging/3.2.1.Final/fedf11b3d4665a434b554a5891fe7f208f029f45/jboss-logging-3.2.1.Final.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/com.fasterxml/classmate/1.1.0/dbbd699a1486ad0f2ed6f5af6cfed66acacb9056/classmate-1.1.0.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-security/9.2.14.v20151106/2d36974323fcb31e54745c1527b996990835db67/jetty-security-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty.websocket/websocket-api/9.2.14.v20151106/94bb91f3880b197ad06e9ac08521433060f2acb7/websocket-api-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/javax.servlet/javax.servlet-api/3.1.0/3cd63d075497751784b2fa84be59432f4905bf7c/javax.servlet-api-3.1.0.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework/spring-context/4.2.4.RELEASE/23cd0109e4eafc5629547e3680b0c4031e82efdd/spring-context-4.2.4.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-plus/9.2.14.v20151106/1e9304873f2d3563d814a1e714add6b6b3ac0b24/jetty-plus-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/javax.annotation/javax.annotation-api/1.2/479c1e06db31c432330183f5cae684163f186146/javax.annotation-api-1.2.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm/5.0.1/2fd56467a018aafe6ec6a73ccba520be4a7e1565/asm-5.0.1.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-commons/5.0.1/7b7147a390a93a14d2edfdcf3f7b0e87a0939c3e/asm-commons-5.0.1.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/log4j/log4j/1.2.17/5af35056b4d257e4b64b9e8069c0746e8b08629f/log4j-1.2.17.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-server/9.2.14.v20151106/70b22c1353e884accf6300093362b25993dac0f5/jetty-server-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-jndi/9.2.14.v20151106/c5fb5420a99b8aee335a3ff804c6094eb9034d04/jetty-jndi-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-tree/5.0.1/1b1e6e9d869acd704056d0a4223071a511c619e6/asm-tree-5.0.1.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-slf4j-impl/2.4.1/1153bec315f388b2635c25cf97105ae9dce61b58/log4j-slf4j-impl-2.4.1.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.3/8d85ef2675d1b45fe78adad021f809bdf12f2eeb/log4j-api-2.3.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/aopalliance/aopalliance/1.0/235ba8b489512805ac13a8f9ea77a1ca5ebe3e8/aopalliance-1.0.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-core/2.3/58a3e964db5307e30650817c5daac1e8c8ede648/log4j-core-2.3.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.25/da76ca59f6a57ee3102f8f9bd9cee742973efa8a/slf4j-api-1.7.25.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.slf4j/jul-to-slf4j/1.7.13/43759e986de5fec7045e35e9533e5ad2f6cd1b05/jul-to-slf4j-1.7.13.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter/1.3.1.RELEASE/622e02ce77b3bea202b596a6fa0c40525ec81e1c/spring-boot-starter-1.3.1.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-actuator/1.3.1.RELEASE/7a1a3945517ee71360e4008bb9724bc4cb8f9fe4/spring-boot-actuator-1.3.1.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework/spring-aop/4.2.4.RELEASE/3329cf71b4bc49c9767ca4f0704ed7b773f29fba/spring-aop-4.2.4.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.aspectj/aspectjweaver/1.8.7/f753e78bbe484e58b3b4e5ce3cc1751e50d11f6c/aspectjweaver-1.8.7.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-validation/1.3.1.RELEASE/47f424e3c7ed629b988b1976e52b662834a76856/spring-boot-starter-validation-1.3.1.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework/spring-web/4.2.4.RELEASE/d4bcc6f4d8b64d7af9b67bc17f0d5106dce97926/spring-web-4.2.4.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework/spring-webmvc/4.2.4.RELEASE/cf4317be9c83b4c1c65ce2d3bb96673ac546030a/spring-webmvc-4.2.4.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-servlets/9.2.14.v20151106/a75c78a0ee544073457ca5ee9db20fdc6ed55225/jetty-servlets-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-webapp/9.2.14.v20151106/773f1c45f6534bff6313997ab3bdbe25533ee255/jetty-webapp-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty.websocket/websocket-server/9.2.14.v20151106/28c95e23ebb8d986cb5bc06b0c640ee2f5cf3bd3/websocket-server-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty.websocket/javax-websocket-server-impl/9.2.14.v20151106/2de6aeba1b3ea44b88f745e1e6ce22646b1ba430/javax-websocket-server-impl-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.apache.tomcat/tomcat-jdbc/8.0.30/44765cbbe3ea864923c16f19e081522f8058a6a5/tomcat-jdbc-8.0.30.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework/spring-jdbc/4.2.4.RELEASE/7aa1c3c817b0a04796e6570a2c07ac23248c1ee0/spring-jdbc-4.2.4.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.slf4j/jcl-over-slf4j/1.7.21/331b564a3a42f002a0004b039c1c430da89062cd/jcl-over-slf4j-1.7.21.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework/spring-context-support/4.1.6.RELEASE/9beaafd3f01cd377e36a2b1a9aed7c2c87111165/spring-context-support-4.1.6.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework/spring-beans/4.2.4.RELEASE/dc8e0874b53435f3e277d9da5aebd8b93cc7cf64/spring-beans-4.2.4.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/com.lmax/disruptor/3.4.1/72fabfe8a183f53bf61e0303921b7a89d2e8daed/disruptor-3.4.1.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/2973d150c0dc1fefe998f834810d68f278ea58ec/junit-4.12.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/com.kohlschutter.junixsocket/junixsocket-common/2.0.4/b4d1870bf903412533e0b79c6fcd402defcfc05b/junixsocket-common-2.0.4.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/com.kohlschutter.junixsocket/junixsocket-native-common/2.0.4/726bd66a934dea39c817382986496fa4eda96411/junixsocket-native-common-2.0.4.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.scijava/native-lib-loader/2.0.2/1451fa03954c5e31a358b411147de472b4dab92c/native-lib-loader-2.0.2.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-compress/1.12/84caa68576e345eb5e7ae61a0e5a9229eb100d7b/commons-compress-1.12.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/commons-codec/commons-codec/1.10/4b95f4897fa13f2cd904aee711aeafc0c5295cd8/commons-codec-1.10.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/commons-lang/commons-lang/2.6/ce1edb914c94ebc388f086c6827e8bdeec71ac2/commons-lang-2.6.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/javax.xml.bind/jaxb-api/2.3.0/99f802e0cb3e953ba3d6e698795c4aeb98d37c48/jaxb-api-2.3.0.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.rnorth/tcp-unix-socket-proxy/1.0.1/72ff1904b2db1cdfc2e9ef0a61be0ee6f9e4736c/tcp-unix-socket-proxy-1.0.1.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.zeroturnaround/zt-exec/1.8/7d6c8d9f6067870cf6822741ad2e8a8fea37bbc1/zt-exec-1.8.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.rnorth.duct-tape/duct-tape/1.0.6/849cdd677ccd969f7a8810294dfe4c7c6dbef308/duct-tape-1.0.6.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-ext/1.7.25/d1685f86e2becda32ad8bb823b8cc4990eb45f69/slf4j-ext-1.7.25.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.rnorth.visible-assertions/visible-assertions/2.1.0/f2fcff2862860828ac38a5e1f14d941787c06b13/visible-assertions-2.1.0.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/jna/4.5.0/55b548d3195efc5280bf1c3f17b49659c54dee40/jna-4.5.0.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.mockito/mockito-core/1.10.19/e8546f5bef4e061d8dd73895b4e8f40e3fe6effe/mockito-core-1.10.19.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-library/1.3/4785a3c21320980282f9f33d0d1264a69040538f/hamcrest-library-1.3.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework/spring-test/4.1.6.RELEASE/89612cafdac51bc92d9bd512e1863a9111a08b4e/spring-test-4.1.6.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.springframework/spring-expression/4.2.4.RELEASE/15b6f6d61bc68fe2cc6cbd63e2329601afb8b39/spring-expression-4.2.4.RELEASE.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.16/d64fb662c9e42789149f5078a62a22edda786c6a/snakeyaml-1.16.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-el/8.0.30/b97d5ff750126d7fdaf412aeec219306bd157e50/tomcat-embed-el-8.0.30.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.hibernate/hibernate-validator/5.2.2.Final/990905cd9184450c5f3e929ab2566305e3a67fa1/hibernate-validator-5.2.2.Final.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-continuation/9.2.14.v20151106/8909d62fd7e28351e2da30de6fb4105539b949c0/jetty-continuation-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-http/9.2.14.v20151106/699ad1f2fa6fb0717e1b308a8c9e1b8c69d81ef6/jetty-http-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-util/9.2.14.v20151106/57e00b912ae0c35859ac81594a996007706a0b/jetty-util-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-io/9.2.14.v20151106/dfa4137371a3f08769820138ca1a2184dacda267/jetty-io-9.2.14.v20151106.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.13/7fcf30c25b8f4a9379b9dad0d3f487b25272c026/slf4j-api-1.7.13.jar:/Users/grey.behrangs/.gradle/caches/modules-2/files-2.1/org.slf4j/jcl-over-slf4j/1.7.13/d78d2242e14e4182625152d225f76ae52b43491d/jcl-over-slf4j-1.7.13.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 AdapterIntegrationTest
INFO Found Docker environment with local Unix socket (via TCP proxy)
INFO Docker host IP address is localhost
INFO Connected to docker: 
  Server Version: 18.03.0-ce
  API Version: 1.37
  Operating System: Docker for Mac
  Total Memory: 1998 MB
INFO Ryuk started - will monitor and terminate Testcontainers containers on JVM exit
        ℹ︎ Checking the system...
        ✔ Docker version should be at least 1.6.0
        ✔ Docker environment should have more than 2GB free disk space
        ✔ File should be mountable
INFO Creating container for image: ibmcom/informix-innovator-c:latest
INFO Starting container with ID: d52872c9cd6c391f55cf82840466911219d5b6d2b4ef0561f6a442e4a718574d
INFO Container ibmcom/informix-innovator-c:latest is starting: d52872c9cd6c391f55cf82840466911219d5b6d2b4ef0561f6a442e4a718574d
ERROR Could not start container
org.rnorth.ducttape.TimeoutException: java.util.concurrent.TimeoutException
    at org.rnorth.ducttape.timeouts.Timeouts.callFuture(Timeouts.java:59) ~[duct-tape-1.0.6.jar:?]
    at org.rnorth.ducttape.timeouts.Timeouts.doWithTimeout(Timeouts.java:49) ~[duct-tape-1.0.6.jar:?]
    at org.testcontainers.containers.wait.WaitAllStrategy.waitUntilReady(WaitAllStrategy.java:21) ~[testcontainers-1.6.0.jar:?]
    at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:521) ~[testcontainers-1.6.0.jar:?]
    at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:243) ~[testcontainers-1.6.0.jar:?]
    at org.testcontainers.containers.GenericContainer.lambda$start$0(GenericContainer.java:194) ~[testcontainers-1.6.0.jar:?]
    at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:76) [duct-tape-1.0.6.jar:?]
    at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:192) [testcontainers-1.6.0.jar:?]
    at org.testcontainers.containers.GenericContainer.starting(GenericContainer.java:628) [testcontainers-1.6.0.jar:?]
    at org.testcontainers.containers.FailureDetectingExternalResource$1.evaluate(FailureDetectingExternalResource.java:29) [testcontainers-1.6.0.jar:?]
    at org.junit.rules.RunRules.evaluate(RunRules.java:20) [junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137) [junit-4.12.jar:4.12]
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) [junit-rt.jar:?]
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) [junit-rt.jar:?]
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) [junit-rt.jar:?]
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) [junit-rt.jar:?]
Caused by: java.util.concurrent.TimeoutException
    at java.util.concurrent.FutureTask.get(FutureTask.java:205) ~[?:1.8.0_161]
    at org.rnorth.ducttape.timeouts.Timeouts.callFuture(Timeouts.java:54) ~[duct-tape-1.0.6.jar:?]
    ... 16 more
ERROR Container log output (if any) will follow:
INFO STDOUT: >>>    Update sqlhost ...
INFO STDOUT: >>>    Create data directory structure in /home/informix/data (ifx initialization)
INFO STDERR: Warning: Parameter's user-configured value was adjusted. (MAX_PDQPRIORITY)
INFO STDOUT: Reading configuration file '/opt/IBM/informix/etc/onconfig.dev'...succeeded
INFO STDOUT: Creating /INFORMIXTMP/.infxdirs...succeeded
INFO STDOUT: Allocating and attaching to shared memory...succeeded
INFO STDOUT: Creating resident pool 4310 kbytes...succeeded
INFO STDOUT: Creating infos file "/opt/IBM/informix/etc/.infos.dev"...succeeded
INFO STDOUT: Linking conf file "/opt/IBM/informix/etc/.conf.dev"...succeeded
INFO STDOUT: Initializing rhead structure...rhlock_t 16384 (512K)... rlock_t (2656K)... Writing to infos file...succeeded
INFO STDOUT: Initialization of Encryption...succeeded
INFO STDOUT: Initializing ASF...succeeded
INFO STDOUT: Initializing Dictionary Cache and SPL Routine Cache...succeeded
INFO STDOUT: Initializing encryption-at-rest if necessary...succeeded
INFO STDOUT: Bringing up ADM VP...succeeded
INFO STDOUT: Creating VP classes...succeeded
INFO STDOUT: Forking main_loop thread...succeeded
INFO STDOUT: Initializing DR structures...succeeded
INFO STDOUT: Forking 1 'soctcp' listener threads...succeeded
INFO STDOUT: Forking 1 'soctcp' listener threads...succeeded
INFO STDOUT: Starting tracing...succeeded
INFO STDOUT: Initializing 8 flushers...succeeded
INFO STDOUT: Initializing log/checkpoint information...succeeded
INFO STDOUT: Initializing dbspaces...succeeded
INFO STDOUT: Opening primary chunks...succeeded
INFO STDOUT: Validating chunks...succeeded
INFO STDOUT: Creating database partition...succeeded
INFO STDOUT: Initialize Async Log Flusher...succeeded
INFO STDOUT: Starting B-tree Scanner...succeeded
INFO STDOUT: Init ReadAhead Daemon...succeeded
INFO STDOUT: Init DB Util Daemon...succeeded
INFO STDOUT: Initializing DBSPACETEMP list...succeeded
INFO STDOUT: Init Auto Tuning Daemon...succeeded
INFO STDOUT: Checking database partition index...succeeded
INFO STDOUT: Initializing dataskip structure...succeeded
INFO STDOUT: Checking for temporary tables to drop...succeeded
INFO STDOUT: Updating Global Row Counter...succeeded
INFO STDOUT: Forking onmode_mon thread...succeeded
INFO STDOUT: Creating periodic thread...succeeded
INFO STDOUT: Creating VP cache drain thread...succeeded
INFO STDOUT: Creating limits manager thread...succeeded
INFO STDOUT: Starting scheduling system...succeeded
INFO STDOUT: Verbose output complete: mode = 5
INFO STDOUT: oninit starting
INFO STDOUT: oninit complete
INFO STDERR: Value for SP_THRESHOLD (10) was saved in config file.
INFO STDERR: Value of SP_THRESHOLD has been changed to 10.
INFO STDERR: 
INFO STDERR: Database selected.
INFO STDERR: 
INFO STDERR: 
INFO STDERR: Permission granted.
INFO STDERR: 
INFO STDOUT: 
INFO STDERR: 
INFO STDERR: Database closed.
INFO STDERR: 
INFO STDERR: 
INFO STDERR: Database selected.
INFO STDERR: 
INFO STDOUT: 
INFO STDOUT: 
INFO STDOUT: 
INFO STDOUT: (expression)  Chunk 1 is now extendable.
INFO STDERR: 
INFO STDERR: 1 row(s) retrieved.
INFO STDERR: 
INFO STDOUT: 
INFO STDERR: 
INFO STDERR: Database closed.
INFO STDERR: 
INFO STDOUT: >>>    Starting up the IBM Informix Database (dev) ...
INFO STDERR: Warning: Parameter's user-configured value was adjusted. (MAX_PDQPRIORITY)

org.testcontainers.containers.ContainerLaunchException: Container startup failed

    at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:199)
    at org.testcontainers.containers.GenericContainer.starting(GenericContainer.java:628)
    at org.testcontainers.containers.FailureDetectingExternalResource$1.evaluate(FailureDetectingExternalResource.java:29)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
    at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:83)
    at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:192)
    ... 9 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
    at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:264)
    at org.testcontainers.containers.GenericContainer.lambda$start$0(GenericContainer.java:194)
    at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:76)
    ... 10 more
Caused by: org.rnorth.ducttape.TimeoutException: java.util.concurrent.TimeoutException
    at org.rnorth.ducttape.timeouts.Timeouts.callFuture(Timeouts.java:59)
    at org.rnorth.ducttape.timeouts.Timeouts.doWithTimeout(Timeouts.java:49)
    at org.testcontainers.containers.wait.WaitAllStrategy.waitUntilReady(WaitAllStrategy.java:21)
    at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:521)
    at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:243)
    ... 12 more
Caused by: java.util.concurrent.TimeoutException
    at java.util.concurrent.FutureTask.get(FutureTask.java:205)
    at org.rnorth.ducttape.timeouts.Timeouts.callFuture(Timeouts.java:54)
    ... 16 more

Test ignored.

Process finished with exit code 255
kiview commented 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,

behrangs-sportsbet commented 6 years ago

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.