Skip to content

After upgrade to 1.16.1 JUnit tests fail on AWS CodeBuild #4594

Closed

Description

When upgrading to 1.16.1, tests using TestContainers start to fail when executed on AWS CodeBuild. Locally they still run successfully. With 1.16.0 they still run successfully.

Here is the stack trace:

Creating container for image: amazon/dynamodb-local:1.15.0
Starting container with ID: cd71e434635d54dc183620bc887d2413bd53184031832709a61fa4c0de4d20f3
Container amazon/dynamodb-local:1.15.0 is starting: cd71e434635d54dc183620bc887d2413bd53184031832709a61fa4c0de4d20f3
Could not start container

org.testcontainers.containers.ContainerLaunchException: Timed out waiting for container port to open (172.18.0.1 ports: [32768] should be listening)
at org.testcontainers.containers.wait.strategy.HostPortWaitStrategy.waitUntilReady(HostPortWaitStrategy.java:89)
at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:51)
at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:929)
at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:468)
at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:331)
at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:329)
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:317)

As a workaround, I added the environment variable TESTCONTAINERS_HOST_OVERRIDE=127.0.0.1. Then the tests pass successfully again.
So it seems that an "external" IP is used for the docker host instead of localhost.

Do you know what changed with detection of the environment that might cause this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions