fix(build): Upgrade testconatiners to 2.0.3#27140
Merged
tdcmeehan merged 1 commit intoprestodb:masterfrom Feb 14, 2026
Merged
Conversation
The current image that runs the CI builds is using the new Docker engine and requires the client version be higher than 1.44. The default client version that is used by the current testcontainer is 1.32 and causes build failures. Upgrade the testcontainers to 2.0.3, related dependencies, and update test cases accordingly. Signed-off-by: Yihong Wang <yh.wang@ibm.com>
Contributor
Reviewer's GuideUpgrades Testcontainers to 2.0.3 and adapts test dependencies and test code (ClickHouse, MySQL, PostgreSQL, Elasticsearch, Hydra OAuth tests) to the new module layout and container APIs so CI and local tests run against a newer Docker client. Sequence diagram for running an integration test with Testcontainers 2.0.3sequenceDiagram
actor Developer
participant Maven as Maven_Surefire
participant TestClass as IntegrationTestClass
participant TC as Testcontainers_2_0_3
participant Docker as Docker_engine
participant DB as Database_container
Developer->>Maven: mvn test
Maven->>TestClass: execute test methods
TestClass->>TC: request container start
TC->>Docker: create_container
Docker-->>TC: container_id
TC->>Docker: start_container(container_id)
Docker-->>TC: container_started
TC-->>TestClass: running_container_info
TestClass->>DB: open_connection_using_JDBC_URL
DB-->>TestClass: connection_established
TestClass->>DB: run_integration_queries
DB-->>TestClass: query_results
TestClass-->>Maven: test_passed
Maven->>TC: shutdown_all_containers
TC->>Docker: stop_container(container_id)
Docker-->>TC: container_stopped
TC->>Docker: remove_container(container_id)
Docker-->>TC: container_removed
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
TestPostgreSqlDistributedQueriesandTestPostgreSqlIntegrationSmokeTest, thepostgresContainerfield no longer appears to be reassigned, so it can remainfinalfor consistency with the other tests and to make the immutability explicit. - The hard-coded
"postgres:14"image tag is now duplicated across several test classes (includingTestingHydraIdentityProvider); consider extracting this to a shared constant to keep the version aligned and make future upgrades simpler.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `TestPostgreSqlDistributedQueries` and `TestPostgreSqlIntegrationSmokeTest`, the `postgresContainer` field no longer appears to be reassigned, so it can remain `final` for consistency with the other tests and to make the immutability explicit.
- The hard-coded `"postgres:14"` image tag is now duplicated across several test classes (including `TestingHydraIdentityProvider`); consider extracting this to a shared constant to keep the version aligned and make future upgrades simpler.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
7 tasks
tdcmeehan
approved these changes
Feb 13, 2026
Member
Author
|
The comments from |
Contributor
|
Agreed, let's ship it. |
7 tasks
This was referenced Mar 31, 2026
15 tasks
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The current image that runs the CI builds is using the new Docker engine and requires the client version be higher than 1.44. The default client version that is used by the current testcontainer is 1.32 and causes build failures.
Upgrade the testcontainers to 2.0.3, related dependencies, and update test cases accordingly.
Motivation and Context
The CI builds fail on lots of PRs, and the root cause is that the version of the
testcontainersis using an old Docker client, which got rejected by the Docker engine that runs on the build image.Impact
Only on the build CI and running the testing locally for those projects that are using testcontainers.
Test Plan
I manually ran projects using testcontainers, and all passed, including:
Wait for the CI to run through all other test suites.
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.
Summary by Sourcery
Upgrade Testcontainers to version 2.0.3 across the project and update dependent test modules to align with the new artifacts and APIs.
Enhancements:
Build: