-
-
Notifications
You must be signed in to change notification settings - Fork 500
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
[Enhancement]: Fails the wait when the container stops #938
Comments
I like this idea, thanks for the proposal. @HofmeisterAn @cristianrgreco @eddumelendez are you doing this check internally in the wait strategy for each implementation language? |
I like this too! Indeed in tc-java there is no fail fast on the wait strategies. However, there is a diagnosis about what's the reason about the failure after the wait strategies have failed https://github.com/testcontainers/testcontainers-java/blob/6fe954ab940ccb674d85aca543fe4c979e8932f0/core/src/main/java/org/testcontainers/containers/GenericContainer.java#L484-L509 |
@frozenbonito I've checked that in |
Yes, it can be achieved in a way similar to |
Proposal
Some strategies assume the container is running.
However, a container may terminate due to an unexpected error, etc. Even in this case,
testcontainers-go
will keep waiting until the timeout.It might be a good idea to check the status of the container while polling and return an error if it was stopped.
Example:
In the following code, mysql container immediately stops due to missing environment variables, but wait.ForSQL continues to wait until the timeout.
The text was updated successfully, but these errors were encountered: