Skip to content
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

Double docker-compose shutdown #342

Closed
DarkFelex opened this issue May 19, 2017 · 3 comments
Closed

Double docker-compose shutdown #342

DarkFelex opened this issue May 19, 2017 · 3 comments

Comments

@DarkFelex
Copy link

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
@bsideup
Copy link
Member

bsideup commented May 29, 2017

Hi @DarkFelex,

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 :)

@bitzl
Copy link

bitzl commented Jun 1, 2017

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.

@bsideup
Copy link
Member

bsideup commented Mar 15, 2018

Since #394 is merged, I'll close this issue. Please feel free to reopen it if it didn't solve your issue.

@bsideup bsideup closed this as completed Mar 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants