shanejansen / touchstone

Touchstone is a testing framework for your services that focuses on component, end-to-end, and exploratory testing.
17 stars 2 forks source link

rm explicitly after retrieving logs instead of with --rm #42

Closed ScottFreeCode closed 2 years ago

ScottFreeCode commented 2 years ago

Fixes #36 by allowing a crashed container to stick around till the logs are captured and the container is destroyed in the stopping step.

Has two disadvantages:

ScottFreeCode commented 2 years ago

I tested the log capturing with a failure to become healthy on both PRs by adding the availability_endpoint parameter and adding an exception to the Python app/main.py and seeing that I got the logs when I ran Touchstone and it failed trying to wait for the service to become healthy.

ScottFreeCode commented 2 years ago

Initially I cautioned:

There is an increased risk of orphaning the container if something catastrophic happens to Touchstone such that it can't run the container stop subroutine, since Docker no longer autoremoves it.

However…

The increased risk is small. Prior to this change, if the container starts successfully and Touchstone dies and cannot signal it to stop, it will not stop either. This risk is only increased by no autoremove for crashed containers being left around if Touchstone also crashes, or if Touchstone crashes between stopping the container and (literally the next line) removing it. So, an existing risk we can't do anything more about, now also applies to a couple unlikely edge cases. Doesn't seem like a big deal the more I think about it.