-
Bug
-
Resolution: Fixed
-
Neutral
-
6.0
-
None
-
-
Empty show more show less
-
Foundation 6, Foundation 7
-
2
Running integration tests locally e.g. mvn clean verify fails with
java.lang.ExceptionInInitializerError
Caused by: org.testcontainers.containers.ContainerLaunchException: Container startup failed
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
Caused by: org.testcontainers.containers.ContainerLaunchException:
Timed out waiting for log output matching '^.*Catalina\.start Server startup in [0-9]+ ms
$'
I dug the integration test setup code for containers and saw the above regex is found at
info.magnolia.integrationtests.docker.IntegrationTestEnvironment#launchApplicationServer) where org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy is used.
According to logs at magnolia-integration-tests/tests/target/integration-tests.log Magnolia actually starts up after ~220K ms (default timeout is 7 minutes) and this is the last line
INFO [amd64/tomcat:9.0-jre8] 19.03.2019 18:40:15 -- STDERR: 19-Mar-2019 17:36:58.817 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [221,447] milliseconds
That line actually won’t be matched by the regex, however fixing the expression doesn't seem to solve the issue. Apparently integration-tests.log is not what is used by the test container to check for when Magnolia is ready.
Asked on Slack if someone else was experiencing the same and dai.ha suggested he fixed it locally by using org.testcontainers.containers.wait.strategy.HttpWaitStrategy which indeed does the trick.