-
-
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
[Bug]: Version 0.32.0 seems to ignore WithStartupTimeout #2633
Comments
It's weird because the wait package has not been modified in this release, and looking at the commits I cannot see any one yet that could affect that part: v0.31.0...v0.32.0 Can you verify if this issue is present with the elasticsearch module too? I'm in Gophercon, but will double check this later Thanks for the report! |
I'm facing the same error after updating to v0.32.0. perhaps it's coming from these changes made to |
Yeap, having the same issue here |
Indeed, I think you are right and that block is not honoring the wait strategies at all. I did forget the possibility of having other wait strategies with custom timeouts, so that fixed 5s one seems incorrect. Let's use this issue for ideas for the fix: I can do a patch release right after that for the fix |
@mdelapenya would it make sense to inject the container request, or its wait strategy, into that |
Should it be just the default if dockerContainer.WaitingFor is nil? |
Hi @KenjiTakahashi thanks for opening this issue. I'm trying to reproduce it and, before hitting the bug, I have a few questions:
When I remove all of them in a local test, I get elasticsearch is failing with the following error:
I verified that the configuration of the container is incorrect, please compare with the current Elasticsearch module we have: https://github.com/testcontainers/testcontainers-go/blob/main/modules/elasticsearch/elasticsearch.go#L43-L67 Is there a reason to not use it? It's already been tuned up by the Elastic folks. The code would just like this: container, err := elasticsearch.Run(ctx, "docker.elastic.co/elasticsearch/elasticsearch:8.14.2")
if err != nil {
t.Fatalf("Could not start container: %s", err)
} Let's address that first, and then we can move on with the startup timeout |
Well, our internal CI is kinda slow and is effectively a "Docker-in-Docker-in-Docker". Things like RYUK tend to not play well in such setup (I'd argue that it rarely plays well in general, but that's unrelated) and the timeouts have to be long to ensure success (maybe not 6m long, but 🤷). We do not listen on I have left out some of the env config for brevity, but here is the actual one: Env: map[string]string{
"discovery.type": "single-node",
"http.publish_host": "_local_",
"http.port": strconv.Itoa(port),
"xpack.security.enabled": "false",
"xpack.security.http.ssl.enabled": "false",
"ES_JAVA_OPTS": "-Xmx256m",
} For the error you're getting, did you get a chance to read it? It complains about the value of Sorry, but none of this sounds related to the issue at hand: That |
@KenjiTakahashi I'm sorry if my comment caused confusion. I was trying to prune the errors I found locally while debugging the repro code snippet in this issue, which is what I usually do with all the PRs and issues we receive. So it could be the case I missed the error here. I'd appreciate completeness in the repro code so I can try to reproduce it with more precision 🙏 Going back to the issue, #2691 #2718 could be related to a potential fix, so I'd suggest bumping to the latest release, I'd like to also understand the reasons and use case for you to use a fixed port for the well-known port of Elasticsearch (9200/tcp ?), as Testcontainers advocates against it. I'm more curious about the use case where the internal port is being obtained as a free port from the OS before hand, and used it as part of the same wait strategy for the cluster health. The current Elasticsearch module does it already for you. |
We had this error reported with updating to 0.32.0, updating to 0.33.0 fixed the issue for us. |
I'm going to close this based on the previous post, if there is still an issue there please reply and we can re-open |
Testcontainers version
0.32.0
Using the latest Testcontainers version?
Yes
Host OS
Linux
Host arch
x86
Go version
1.22
Docker version
.
Docker info
.
What happened?
After updating to
0.32.0
, we started getting errors like this:Our setup code is like this:
We've tried changing the value of
WithStartupTimeout
, but the error always says5s
.Version
0.31.0
still works as expected.Relevant log output
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: