-
Notifications
You must be signed in to change notification settings - Fork 141
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
Unable to provide timeout for waiting #247
Comments
Correct. Generally, we try to ship What is the usecase in which you would have needed a timeout? While it would certainly be possible to pass or configure one, I'd be more interested in making it harder / impossible to use a docker image through testcontainers in a way that it wouldn't successfully start up. |
The issue I ran into is that it looks like Postgres containers fail to start up properly on GitHub actions. So the expected line doesn't show up in the logs, and the whole job is stuck.
I think there will always be a case you didn't think about. Allowing to put in a timeout make total sense to me. |
That makes sense, thanks for sharing! |
Do you think we should have a fixed timeout or something that is configurable per container? I am leaning towards a global one that can maybe be overridden through an env variable to keep the images themselves simple. |
Sounds reasonable to me. If additional requirements come up, it should be easy to extend. But it should also cover most cases already. |
I propose a default timeout of 1 minute for now. If we want to make this configurable, #259 should be a good foundation for that. I am thinking of something like:
|
Closes #247 - Sets default startup timeout to 1 minute - Allows to override with `RunnableImage::with_startup_timeout` Note: breaking change because of default timeout For now, ENV variable to configure global timeout isn't introduced. First of all, that's quote similar to other languages, (e.g [Go](https://golang.testcontainers.org/features/wait/introduction/#startup-timeout-and-poll-interval), [Java](https://java.testcontainers.org/features/startup_and_waits/)) Another question is which one should take precedence: ENV over `with_startup_timeout` or vice versa? We can extend it later in compatible way, so not that important at the moment.
Closes #247 - Sets default startup timeout to 1 minute - Allows to override with `RunnableImage::with_startup_timeout` Note: breaking change because of default timeout For now, ENV variable to configure global timeout isn't introduced. First of all, that's quote similar to other languages, (e.g [Go](https://golang.testcontainers.org/features/wait/introduction/#startup-timeout-and-poll-interval), [Java](https://java.testcontainers.org/features/startup_and_waits/)) Another question is which one should take precedence: ENV over `with_startup_timeout` or vice versa? We can extend it later in compatible way, so not that important at the moment.
When using "wait for" there seems to be no timeout.
While you can add a timeout to tests in general, it would make more sense for me to put a much shorter timeout for the startup of a container.
The text was updated successfully, but these errors were encountered: