How can we run multiple test containers that use mongodb at the same time? #588
-
Currently, if more than one of our pipelines run on the same machine, they will run into the issue of both trying to use port 27017 to run a mongodb container for the integration tests. Is there a way to get around that limitation and be able to run two or more instances of the same integration tests at the same time? Perhaps by being able to dynamically assign the container port through a shell variable. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
Yes, Testcontainers maps the container port (in your case I assume you bind a fix host port. Can you share your configuration? |
Beta Was this translation helpful? Give feedback.
Yes, Testcontainers maps the container port (in your case
27017
) automatic to a random host port. This allows running multiple instances at the same time. It is the default behaviour.I assume you bind a fix host port. Can you share your configuration?