Skip to content

fix(redis): Use wait strategy instead of deprecated decorator - #941

Closed
rmnigm wants to merge 2 commits into
testcontainers:mainfrom
rmnigm:main
Closed

fix(redis): Use wait strategy instead of deprecated decorator#941
rmnigm wants to merge 2 commits into
testcontainers:mainfrom
rmnigm:main

Conversation

@rmnigm

Copy link
Copy Markdown

Part of fixing #874.

@rmnigm
rmnigm marked this pull request as ready for review December 22, 2025 15:53
@codecov

codecovBot commented Jan 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.93%. Comparing base (2d9eee3) to head (0a9bb27).
⚠️ Report is 28 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #941 +/- ##
==========================================
- Coverage 78.18% 77.93% -0.25% 
==========================================
Files 14 14 Lines 1210 1210 Branches 187 187 ==========================================
- Hits 946 943 -3 - Misses 222 226 +4 + Partials 42 41 -1 

☔ 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.

@Tranquility2Tranquility2 added 🔧 fix 🛠️ needs more work Need to invest more time, can be a rebase or code updates labels Apr 3, 2026
alexanderankin added a commit that referenced this pull request Jun 3, 2026
…943)
# 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:
- #899 (MinIO - merged)
- #915 (Elasticsearch - merged)
- #935 (Postgres - merged)
- #903 (Kafka/Redpanda - open)
- #914 (Redis - open)
- #941 (Redis - open)
## 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.
Co-authored-by: David Ankin <daveankin@gmail.com>
@alexanderankin

Copy link
Copy Markdown
Member

believe this has already been fixed

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔧 fix🛠️ needs more workNeed 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

@rmnigm@alexanderankin@Tranquility2