-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
After upgrade to 1.16.1 JUnit tests fail on AWS CodeBuild #4594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Same issue here (on AWS CodeBuild using the |
Can you please set your Testcontainers logs to DEBUG level (see here https://www.testcontainers.org/supported_docker_environment/logging_config/) and provide all the logs of the test run? If you would be able to create some kind of local reproducer, this would also be helpful, but I get that this might be challenging or nearly impossible. |
Unfortunately I cannot provide a local reproducer, but here's the debug output you wanted to see for the following 3 tests. @Testcontainers
class KafkaIT {
@SuppressWarnings("deprecation")
@Container
private static final KafkaContainer KAFKA = new KafkaContainer();
@Test
void smokeTest() {
assertTrue(KAFKA.isRunning());
}
} @Testcontainers
class PostgresIT {
@SuppressWarnings("deprecation")
@Container
private static final PostgreSQLContainer POSTGRES = new PostgreSQLContainer();
@Test
void smokeTest() {
assertTrue(POSTGRES.isRunning());
}
} @Testcontainers
class SeleniumIT {
@SuppressWarnings("deprecation")
@Container
private static final BrowserWebDriverContainer<?> chrome = new BrowserWebDriverContainer().withCapabilities(new ChromeOptions());
@Test
void smokeTest() {
assertTrue(chrome.isRunning());
}
} |
@joschi Thanks a lot, this is already helpful and we find some log lines that might help us pinpoint the issue:
Can you run the same tests using Testcontainers 1.16.0 as well and share the logs? Also, please change debug level of |
@kiview Here's the output with Testcontainers 1.16.0: |
@joschi Extremely helpful, thanks. As we can see, the logs I was suspecting to be pointing at the issue, are similar in 1.16.0:
|
We've found (and we believe fixed) a fairly nasty race condition in our port waiting code. This bug affects 1.16.1 and isn't specific to Docker-in-Docker setups, but is more likely to occur for containers with multiple ports and in environments where ports take longer to become visibly open externally. Would anybody care to try a pre-release build to see? The following page documents how to obtain branch builds using JitPack (in this case, the https://www.testcontainers.org/jitpack_dependencies/ I wouldn't rule out the possibility that we're chasing two issues, but 🤞 |
@rnorth I re-ran our build job with the following dependencies (via JitPack):
The tests succeeded this time. Here's the debug output for the successful run: |
@joschi - thanks for testing! I am relieved! |
Fixed by #4597, thanks to everyone helping in debugging this! 🙇 |
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:
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?
The text was updated successfully, but these errors were encountered: