Uploaded image for project: 'Community Edition'
  1. Community Edition
  2. MGNLCE-162

Integration tests fail locally

    XMLWordPrintable

    Details

    • Sprint:
      Foundation 6, Foundation 7
    • Story Points:
      2

      Description

      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.

        Checklists

        Acceptance criteria

          Attachments

            Activity

              People

              Assignee:
              fgrilli Federico Grilli
              Reporter:
              fgrilli Federico Grilli
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Checklists

                  Bug DoR
                  DoD

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0d
                    0d
                    Logged:
                    Time Spent - 0.25d
                    0.25d