Skip to content

Conversation

@pmorch
Copy link

@pmorch pmorch commented Dec 27, 2025

fix(mongodb): Use wait strategy instead of deprecated wait_for_logs

Summary

Replace the deprecated wait_for_logs function with LogMessageWaitStrategy in the MongoDB container module.

This is part of a fix for #874 and similar to:

Changes

  • Import LogMessageWaitStrategy instead of wait_for_logs
  • Pass _wait_strategy=LogMessageWaitStrategy(...) to parent constructor
  • Override _connect() with empty implementation (DbContainer's base implementation uses SQLAlchemy which doesn't apply to MongoDB)

Testing

All existing MongoDB tests pass:

poetry run pytest modules/mongodb/tests/ -v
======================== 4 passed in 16.26s ========================

No deprecation warnings from testcontainers after this change.

Replace the deprecated wait_for_logs function with LogMessageWaitStrategy
in the MongoDB container module.

Part of fix for testcontainers#874
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant