FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(mongodb): Use wait strategy instead of deprecated wait_for_logs by pmorch · Pull Request #943 · testcontainers/testcontainers-python · GitHub

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

Merged
alexanderankin merged 2 commits into
testcontainers:mainfrom
pmorch:fix/mongodb-deprecated-wait-strategy
Jun 3, 2026
Merged

fix(mongodb): Use wait strategy instead of deprecated wait_for_logs#943
alexanderankin merged 2 commits into
testcontainers:mainfrom
pmorch:fix/mongodb-deprecated-wait-strategy

Conversation

pmorch commented Dec 27, 2025

Copy link
Copy Markdown
Contributor

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

codecov Bot commented Jan 19, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.29%. Comparing base (37093ab) to head (468ddb5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #943   +/-   ##
=======================================
  Coverage   83.29%   83.29%           
=======================================
  Files          16       16           
  Lines        1754     1754           
  Branches      193      193           
=======================================
  Hits         1461     1461           
  Misses        236      236           
  Partials       57       57           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Tranquility2 added 🔧 fix 🛠️ needs more work Need to invest more time, can be a rebase or code updates labels Apr 3, 2026
alexanderankin merged commit c8118e7 into testcontainers:main Jun 3, 2026
9 checks passed
alexanderankin added a commit that referenced this pull request Jun 3, 2026
🤖 I have created a release *beep* *boop*
---


##
[4.15.0-rc3](testcontainers-v4.15.0-rc2...testcontainers-v4.15.0-rc3)
(2026-06-03)


### Features

* **core:** add Podman compatibility
([#1028](#1028))
([37093ab](37093ab))
* **core:** auto-detect DOCKER_HOST from current docker context
([#1026](#1026))
([d4b8ff6](d4b8ff6)),
closes
[#1025](#1025)


### Bug Fixes

* **core:** add container logs to TimeoutError when wait strategy times
out
([#1007](#1007))
([1fadb40](1fadb40))
* **core:** close Reaper socket at interpreter exit to prevent
ResourceWarning
([#1017](#1017))
([d3a1517](d3a1517))
* **cosmosdb:** replace distutils.strtobool removed in Python 3.12
([#1018](#1018))
([3e487f4](3e487f4))
* **mongodb:** Use wait strategy instead of deprecated wait_for_logs
([#943](#943))
([c8118e7](c8118e7))
* **mssql:** use `ExecWaitStrategy` instead of deprecated
`wait_container_is_ready`
([#1016](#1016))
([4c53b89](4c53b89)),
closes
[#874](#874)
* **neo4j:** Swap out use of depricated wait utils for wait_strategies
([#1012](#1012))
([6deaf3b](6deaf3b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: David Ankin <daveankin@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔧 fix 🛠️ needs more work Need to invest more time, can be a rebase or code updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL