fix(MongoDb): Wait for post-init startup readiness before replica set initiation#1656
Conversation
✅ Deploy Preview for testcontainers-dotnet ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe change introduces a readiness wait mechanism in MongoDB container initialization that pauses before attempting to initiate the replica set, preventing the replica set initialization from executing while the container is still stabilizing during startup. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What does this PR do?
The PR changes how the MongoDB replica set is initiated. Instead of initiating it immediately, it now waits until the final process is running.
The official MongoDB image starts
mongodtwice during the first-time initialization (bootstrap + final process). Waiting prevents the replica set from being initiated while this handover is in progress, which could otherwise cause the container startup to fail (container exits).Why is it important?
We occasionally saw MongoDB tests fail because the container exited during startup with:
Related issues
Summary by CodeRabbit