-
-
Notifications
You must be signed in to change notification settings - Fork 512
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]: port not found when calling #2602
Comments
Just a quick updatee as I have gone back a few versions of testcontainers-go and this issue is still prevalent, so maybe it is in issue with something that has changed in the docker engine... |
Sorry, I might have opened this prematurely, but I will leave the solution here for anyone else that runs into this. Adding a wait.ForListeningPort did the trick. Not entirely sure why we didn't need this before because we have been using this for a few months, but maybe something changed either in the image we were using or in docker itself that made it start up faster than before. I think this can be closed. |
Hi @webstradev, in general, we recommend adding wait strategies to the containers in order to have the containers in the desired state before continuing with the tests, so I think it makes sense to have the wait strategy you mentioned. Besides that, there are a few issues related to ports not being found, where #2580 could relate to this one. As you suggested, I'm closing this one because of that. Thanks! |
Testcontainers version
0.31.0
Using the latest Testcontainers version?
Yes
Host OS
MacOS
Host arch
ARM
Go version
1.22.3
Docker version
Client: Version: 26.1.4 API version: 1.45 Go version: go1.21.11 Git commit: 5650f9b Built: Wed Jun 5 11:26:02 2024 OS/Arch: darwin/arm64 Context: desktop-linux Server: Docker Desktop 4.31.0 (153195) Engine: Version: 26.1.4 API version: 1.45 (minimum version 1.24) Go version: go1.21.11 Git commit: de5c9cf Built: Wed Jun 5 11:29:12 2024 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.6.33 GitCommit: d2d58213f83a351ca8f528a95fbd145f5654e957 runc: Version: 1.1.12 GitCommit: v1.1.12-0-g51d5e94 docker-init: Version: 0.19.0 GitCommit: de40ad0
Docker info
What happened?
Since about a week we updated to testcontainers 0.31.0. Now when running container.MappedPort(ctx, "4222/tcp") (which our code does in various places. We almost always get back a port not found error.
Restarting docker causes the tests to sometimes work once and then we need to restart it again.
Likely good to mention that these containers are added to a network through the go sdk.
Relevant log output
Additional information
We have had this issue only one week and I believe only since we updated to 0.31.0.
I see some issues on the changelog relating to host binding so maybe there is some regression.
The text was updated successfully, but these errors were encountered: