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
HostPortWaitStrategy strategy does not work for localhost bound ports #686
Comments
@jalaziz @cristianrgreco any solution for this? I was in a previous project using: const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
.withEnvironment({
...
})
.withWaitStrategy(serviceName, Wait.forHealthCheck())
.up([serviceName]); But now for a new project with lot of dependencies updated (ESM modules, different Node version...), it times out saying testcontainers-node/packages/testcontainers/src/wait-strategies/host-port-wait-strategy.ts Lines 45 to 57 in 9805f22
Note I tried to use Thank you, EDIT: I'm on a MacOS Intel EDIT2: I did other attempts to run the test without ESM settings into my Jest setup, but it's the same error. It's so weird... EDIT3: On my side I'm using the strategy |
After spending some time on it, it seems my old way of bindings ports to make them random on the list:
is not working for any reason on the new project. Switching to:
Don't tell why... the old way is working in a project with direct dependencies versions aligned (also I don't remember why I had to use the |
Unfortunately no solution. I've switched to |
Expected Behaviour
When launching a container with a port bound to localhost, the wait strategy should work.
Actual Behaviour
The
HostPortWaitStrategy
fails to recognize the open port and eventually times out. This issue seems to only occur on Linux machines. MacOS works fine.Testcontainer Logs
Steps to Reproduce
Environment Information
The text was updated successfully, but these errors were encountered: