Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done.
Hold a connection to the ryuk container during the lifetime of the Up call.
Benefit
More complex or longer start up time docker compose files will be able to start without requiring users to set higher timeout configurations.
Alternatives
Increasing the ryuk connection/reconnect timeouts. This would help, but it requires every runner of the test to know to set the higher timeout. Because we know we don't want to close the ryuk container while Up is being run, it makes sense to make it work without the need for configuration changes.
Problem
When using the compose module and the services take a bit to start up, the ryuk container will timeout and close during the call to Up.
Examples in https://github.com/testcontainers/testcontainers-go/issues/2618 https://github.com/testcontainers/testcontainers-go/issues/2563
Solution
Hold a connection to the ryuk container during the lifetime of the Up call.
Benefit
More complex or longer start up time docker compose files will be able to start without requiring users to set higher timeout configurations.
Alternatives
Increasing the ryuk connection/reconnect timeouts. This would help, but it requires every runner of the test to know to set the higher timeout. Because we know we don't want to close the ryuk container while Up is being run, it makes sense to make it work without the need for configuration changes.
Would you like to help contributing this feature?
Yes