Skip to content

How can we run multiple test containers that use mongodb at the same time? #588

Answered by HofmeisterAn
PatrickGhosn asked this question in Q&A
Discussion options

You must be logged in to vote

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?

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?

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@HofmeisterAn
Comment options

@PatrickGhosn
Comment options

@HofmeisterAn
Comment options

@PatrickGhosn
Comment options

@HofmeisterAn
Comment options

Answer selected by PatrickGhosn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants