I’m using mongodb/mongodb-atlas-local:8.0.3 in docker compose locally, in integation tests (using TestContainers) and in github actions.
Every few runs the container fails to start, in which case I need to stop it and try again. This is happening very randomly and I can’t put my finger on what might be causing it.
Since it’s happening in various configuration I assume it’s not OS related etc.
I tried other tags of the image but had the same experience.
Hi @Oran_Halberthal , are you seeing the container fail to start in all three instances (compose, integration tests, and github actions)? Specifically, for Docker Compose does your docker-compose file specify a hostname for the mongodb service, similar to this example?
i.e. we wait for the shell command ‘runner healthcheck’ to return a non-zero response, which happens when MongoT and MongoD are initialised. We don’t rely on the default health check, because the intervals are so large you can end up waiting 30s for it to start (even though it also calls the same runner healthcheck).
I’m interested to know if there is any issue with this TestContainers health check - if it is happening in TestContainers I’d appreciate if you could raise an issue here:
@Jonny_Roberts please also let us know if you see an issue with that wait implementation.
Here’s how I use TestContainers with their nice JUnit annotation:
@Testcontainers
class SomeTest {
@Container
private static final MongoDBAtlasLocalContainer mongoDBContainer = new MongoDBAtlasLocalContainer("mongodb/mongodb-atlas-local:8.0.5");
Hi @Oran_Halberthal , can you add the environment variable to your docker-compose file RUNNER_LOG_FILE=/dev/stdout and share these logs (on the same GitHub issue), as well as the output from docker inspect [container name], please?
@Jonny_Roberts I added the env variable to the test containers config because the issue is happening when I run my integration tests (either locally or in github actions)
Thanks @Oran_Halberthal , I’ll review this with the team here and get back asap.
In the meantime, can you just confirm that you’re still seeing the same intermittent failing in all three implementations (Docker Compose, TestContainers, and GitHub Actions), please?