question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After upgrade to 1.16.1 JUnit tests fail on AWS CodeBuild

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
joschicommented, Oct 22, 2021

@rnorth I re-ran our build job with the following dependencies (via JitPack):

  • com.github.testcontainers.testcontainers-java:testcontainers:e257baca07
  • com.github.testcontainers.testcontainers-java:junit-jupiter:e257baca07
  • com.github.testcontainers.testcontainers-java:postgresql:e257baca07
  • com.github.testcontainers.testcontainers-java:kafka:e257baca07
  • com.github.testcontainers.testcontainers-java:selenium:e257baca07

The tests succeeded this time. Here’s the debug output for the successful run: testcontainers-debug.txt

0reactions
kiviewcommented, Oct 22, 2021

Fixed by #4597, thanks to everyone helping in debugging this! 🙇

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting AWS CodeBuild
Provides troubleshooting information for AWS CodeBuild. ... Issue: When you try to update a project in the console, the update failed with this...
Read more >
Working with test reporting in AWS CodeBuild
You can create reports in CodeBuild that contain details about tests that are run during builds. You can create tests such as unit...
Read more >
Test Reports with AWS CodeBuild | AWS DevOps Blog
The following sample buildspec.yml file generates test reports from JUnit tests using Surefire and stores it in the Report Group named ...
Read more >
Create a test report in CodeBuild using the AWS CLI sample
You specify the location of your test files in the buildspec file. The following test report file formats are supported: Cucumber JSON (.json)....
Read more >
Specify test commands - AWS CodeBuild
The following is a sample commands section that includes commands to run the tests in ... commands: - echo Running tests for surefire...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found