Skip to content

.Net: Fix MongoDB test container ready detection #13026

Merged
westey-m merged 2 commits intomicrosoft:mainfrom
damieng:mongodb-testcontainer-ready-check
Aug 29, 2025
Merged

.Net: Fix MongoDB test container ready detection #13026
westey-m merged 2 commits intomicrosoft:mainfrom
damieng:mongodb-testcontainer-ready-check

Conversation

@damieng
Copy link
Copy Markdown
Contributor

@damieng damieng commented Aug 28, 2025

Motivation and Context

To fix unreliable MongoDB Test Container start-up.

Fixes #13025

Description

TestContainers.NET is, by default checking, for the string Waiting for connections to appear TWICE in the MongoDB logs before deciding the container is available. While this can happen quite often it doesn't always happen and I believe this is a mistake (introduced in a large PR).

TestContainers clients for Go and Rust only check the message appears once (and TestContainers for Java has a different mechanism altogether).

This introduces an alternative waiting mechanism until I can get the fix shipped upstream that only checks the message appears once.

Note: This PR does not yet enable the MongoDB tests as I think there are some other intermittent issues relating to the use of lock/counting mechanism that sometimes responds with a very different error.

Contribution Checklist

@damieng damieng requested a review from a team as a code owner August 28, 2025 07:58
@moonbox3 moonbox3 added the .NET Issue or Pull requests regarding .NET code label Aug 28, 2025
@github-actions github-actions bot changed the title Fix MongoDB test container ready detection .Net: Fix MongoDB test container ready detection Aug 28, 2025
@westey-m westey-m added this pull request to the merge queue Aug 29, 2025
Merged via the queue into microsoft:main with commit 38a7d91 Aug 29, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Issue or Pull requests regarding .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.Net: MongoDB Test Container start-up is not reliable

4 participants