You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered strange behaviour of DockerComposeContainer class. After a test run in a clean up stage TestContainers logs exception org.testcontainers.shaded.com.github.dockerjava.api.exception.NotFoundException: {"message":"No such container: 36ae55e90e479816118eddda6db1a9704a170cf3272ea94aafedd7831e14ad7e"}. It happens because method DockerComposeContainer.finished first stops ambassador container, then shuts down docker-compose, and finally kills spawned service containers (https://github.com/testcontainers/testcontainers-java/blob/master/core/src/main/java/org/testcontainers/containers/DockerComposeContainer.java#L250). And it looks strange to me as service containers must be already stopped with docker-compose down -v on the previous step (L 243).
Richard and I have discussed this moment via e-mail and he proposed to do one or both of following things:
use the exit code from docker-compose down to know whether the final cleanup is actually needed
check if container is still running before taking attempt to stop it
The text was updated successfully, but these errors were encountered:
For me "check if container is still running before taking attempt to stop it" sounds much better because potentially it might help with any container, not only the ones started by docker-compose :)
We see this behavior, too. Our integration tests finish with the exception above (albeit successful), and the admins of our build servers get Syslog notifications of docker trying to remove the containers again.
The second solution ("check if container is still running") sounds like a flexible and robust approach.
I've encountered strange behaviour of
DockerComposeContainer
class. After a test run in a clean up stage TestContainers logs exceptionorg.testcontainers.shaded.com.github.dockerjava.api.exception.NotFoundException: {"message":"No such container: 36ae55e90e479816118eddda6db1a9704a170cf3272ea94aafedd7831e14ad7e"}
. It happens because methodDockerComposeContainer.finished
first stops ambassador container, then shuts down docker-compose, and finally kills spawned service containers (https://github.com/testcontainers/testcontainers-java/blob/master/core/src/main/java/org/testcontainers/containers/DockerComposeContainer.java#L250). And it looks strange to me as service containers must be already stopped withdocker-compose down -v
on the previous step (L 243).Richard and I have discussed this moment via e-mail and he proposed to do one or both of following things:
docker-compose down
to know whether the final cleanup is actually neededThe text was updated successfully, but these errors were encountered: