Open Nicklas2751 opened 4 years ago
up
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this.
Hey @Nicklas2751,
the example project does indeed reproduce the issue for me. There might to be a problem with the DockerComposeContainer
object not correctly cleaning up its previous state on stop
.
I have a application which I want to run selenium tests (JUnit 4). I start the application it's database and a elastic search service with a docker compose file. I also start a chrome or firefox browser container depending on a setting. For my first test class this works perfectly but after that the compose services getting restarted. This isn't a problem but it results in socat trying to connect to the application itself right direct after the application container begone to start without waiting for the service to be healthy. Because the application needs a couple of minutes to start the exposed port isn't available and socat fails like this:
Since I am not allowed to post the whole code, here is an excerpt with the most important:
My docker compose file looks like this:
And this are the dependencies I am using:
I run it with
./mvnw clean test -Pchrome,BasicTestSuite
My docker version:
And docker compose:
Java version:
I have managed to reproduce the problem in a sample project: https://github.com/Nicklas2751/testcontainers-issue-example To run it and reproduce the problem:
./mvnw clean test -Pchrome,BasicTestSuite
Let me know if you need more information or if I can help.