Skip to content

Tests: Process deprecation warnings of testcontainers package#680

Merged
amotl merged 1 commit intomainfrom
modernize-testcontainers
Mar 5, 2026
Merged

Tests: Process deprecation warnings of testcontainers package#680
amotl merged 1 commit intomainfrom
modernize-testcontainers

Conversation

@amotl
Copy link
Member

@amotl amotl commented Mar 5, 2026

Follow advises from testcontainers maintainers.

@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e43fc901-4ec3-4095-885f-8af1e2bb50c9

📥 Commits

Reviewing files that changed from the base of the PR and between 1052063 and 4cfb28b.

📒 Files selected for processing (4)
  • cratedb_toolkit/testing/testcontainers/cratedb.py
  • cratedb_toolkit/testing/testcontainers/influxdb2.py
  • cratedb_toolkit/testing/testcontainers/minio.py
  • cratedb_toolkit/testing/testcontainers/mongodb.py

Walkthrough

Replaces decorator-based container readiness waits with programmatic LogMessageWaitStrategy for CrateDB and InfluxDB; removes @wait_container_is_ready decorators from Minio and MongoDB methods while keeping their public signatures unchanged.

Changes

Cohort / File(s) Summary
CrateDB container wait refactor
cratedb_toolkit/testing/testcontainers/cratedb.py
Remove @wait_container_is_ready and _wait_for_node_startup; add re import, _configure_wait_condition and _wait_strategy helpers; use LogMessageWaitStrategy (regex o\.e\.n\.Node.*started) and call wait_for_logs programmatically during configuration.
InfluxDB wait strategy switch
cratedb_toolkit/testing/testcontainers/influxdb2.py
Remove @wait_container_is_ready and MAX_TRIES; add re and LogMessageWaitStrategy import and configure a log-wait (regex like Listening.*tcp-listener.*8086) in _configure; drop decorator-based waits from _connect.
Decorator removals (no signature changes)
cratedb_toolkit/testing/testcontainers/minio.py, cratedb_toolkit/testing/testcontainers/mongodb.py
Remove @wait_container_is_ready() decorators and corresponding imports from ExtendedMinioContainer.list_object_names and MongoDbContainerWithKeepalive.get_connection_url; method signatures and bodies otherwise unchanged.
Imports / cleanup across testcontainers
cratedb_toolkit/testing/testcontainers/...
Update imports: add re and testcontainers.core.wait_strategies.LogMessageWaitStrategy where used; remove wait_container_is_ready / wait_for_logs imports where replaced.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐇 I tuned my regex, ears all bright,

logs now hum in morning light.
No more decorators hiding the play,
containers wake and stretch all day. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating test infrastructure to address deprecation warnings from the testcontainers package by modernizing wait strategies.
Description check ✅ Passed The description is concise but directly related to the changeset, referring to following testcontainers maintainers' advice to process deprecation warnings.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch modernize-testcontainers

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@amotl amotl force-pushed the modernize-testcontainers branch from 57347f3 to 1052063 Compare March 5, 2026 07:40
@amotl amotl force-pushed the modernize-testcontainers branch from 1052063 to 4cfb28b Compare March 5, 2026 07:46
@amotl amotl marked this pull request as ready for review March 5, 2026 08:13
@amotl amotl merged commit e3373c9 into main Mar 5, 2026
7 checks passed
@amotl amotl deleted the modernize-testcontainers branch March 5, 2026 08:13
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