GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||
GeezerVison is showing github.com — feat: Add ExecWaitStrategy and migrate Postgres from deprecated decorator by tylernisonoff · Pull Request #935 · testcontainers/testcontainers-python Conversation
Contributor
ProblemThe SolutionThis PR introduces a new Changes
Design Consideration: Protocol LimitationsIssue: The Current Solution: Runtime check with Discussion Points:
I've opted for the runtime check to maintain consistency with the existing PR Checklist
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsReplace deprecated @wait_container_is_ready decorator in PostgresContainer with new ExecWaitStrategy for checking database readiness. - Add ExecWaitStrategy to core wait_strategies module for command-based readiness checks - Update PostgresContainer._connect() to use ExecWaitStrategy with psql - Remove dependency on deprecated wait_container_is_ready decorator - Strategy executes psql command to verify database is accepting connections - Add runtime check for exec support (DockerContainer only) The new ExecWaitStrategy is reusable for any DockerContainer that needs to execute commands to check readiness (databases, CLI tools, etc). Note: ExecWaitStrategy requires containers with exec support and will not work with ComposeContainer. The runtime check provides a clear error if used incorrectly.
alexanderankin
approved these changes
|
There was an error while loading. Please reload this page.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## main #935 +/- ## ========================================== - Coverage 79.78% 78.18% -1.60% ========================================== Files 14 14 Lines 1182 1210 +28 Branches 184 187 +3 ========================================== + Hits 943 946 +3 - Misses 197 222 +25 Partials 42 42 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
🤖 I have created a release *beep* *boop* --- ## [4.14.0](testcontainers-v4.13.3...testcontainers-v4.14.0) (2026-01-07) ### Features * Add ExecWaitStrategy and migrate Postgres from deprecated decorator ([#935](#935)) ([2d9eee3](2d9eee3)) ### Bug Fixes * add ruff to deps ([#919](#919)) ([5853d32](5853d32)) * **cassandra,mysqk,kafka:** Use wait strategy instead of deprecated wait_for_logs ([#945](#945)) ([b7791b9](b7791b9)) * **core:** recreate poetry lockfile with latest versions of libraries ([#946](#946)) ([9a97385](9a97385)) * **elasticsearch:** Use wait strategy instead of deprecated decorator ([#915](#915)) ([c785ecd](c785ecd)) * **minio:** minio client requires kwargs now ([#933](#933)) ([37f5902](37f5902)) * **minio:** Use wait strategy instead of deprecated decorator ([#899](#899)) ([febccb7](febccb7)) --- 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: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…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 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.