You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
method - resolveHostPortBinding
line - return hostPortBindings[0].hostPort;
Actual Behaviour
We have tests that are running in parallel and it was quite hard to identify that issue, because locally on mac os everything is fine, but on latest ubuntu the problem auto assigning port appear
Thanks for raising, I'll need to look into it. Testcontainers resolves a list of host IPs, the order of which is determined by several factors like node version and OS. When we get the mapped port we probably need to find the port where the host matches the order, similar as you've done
The order actually is quite random, even in one test execution, we do start redis & postgres, we have around 20 files with tests, and for each file we start dbs, and some files are passing and some not, seems like it's super random from docker side.
Expected Behaviour
I want to get a predictable port number and host,
the problem seems to be in this file - https://github.com/testcontainers/testcontainers-node/blob/main/packages/testcontainers/src/utils/bound-ports.ts
method - resolveHostPortBinding
line - return hostPortBindings[0].hostPort;
Actual Behaviour
We have tests that are running in parallel and it was quite hard to identify that issue, because locally on mac os everything is fine, but on latest ubuntu the problem auto assigning port appear
testcontainers/testcontainers-dotnet#825 - same issue for .net
So what happening:
Testcontainer Logs
...
Steps to Reproduce
Environment Information
we temporary fixed it by retrieving ipv4 port from the docker inspect info:
The text was updated successfully, but these errors were encountered: