Repository navigation
Conversation
…se modules new HashSet<>(getMappedPort(HTTP_PORT)) calls the HashSet(int initialCapacity) constructor, so getLivenessCheckPortNumbers() returned an empty set. Databend and Timeplus use Wait.forHttp(...) without forPort, and HttpWaitStrategy returns right away when there are no liveness check ports, so those containers were reported as started without waiting for the HTTP endpoint. Return the mapped HTTP port instead, as testcontainers#5734 did for MySQL and Db2.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
DatabendContainer,TimeplusContainerand bothClickHouseContainerclasses overridegetLivenessCheckPortNumbers()withThat calls the
HashSet(int initialCapacity)constructor, so the method always returns an empty set. It's the same bug #5734 fixed for the MySQL and Db2 modules; these modules were added later with the same line.For Databend and Timeplus this means the wait strategy doesn't wait. Both use
Wait.forHttp(...)withoutforPort(...), soHttpWaitStrategytakes its port fromgetLivenessCheckPorts(). When that's empty, it logs "No exposed ports or mapped ports - cannot wait for status" and returns, sostart()finishes before the HTTP endpoint is up. ClickHouse usesforPort(HTTP_PORT), so its wait isn't affected, but the method still returned the wrong value.They now return
Collections.singleton(getMappedPort(HTTP_PORT)), so the HTTP port is still the only liveness check port, like before.Tests
Each module's container test has a new
livenessCheckPortIsTheMappedHttpPorttest. It overridesgetMappedPortinstead of starting a container, so it doesn't need Docker, and checks thatgetLivenessCheckPortNumbers()contains exactly the mapped HTTP port. All four (Databend, Timeplus,clickhouse.ClickHouseContainerand the deprecatedcontainers.ClickHouseContainer) fail onmainwith[]and pass with this change.Ran locally: the new tests, plus
checkstyleMain checkstyleTest spotlessCheck japicmpfor the three modules. I couldn't run the existing container-based tests of these modules locally, because my Docker's image store is read-only right now and pulling images fails, independent of this change. CI should cover those.Summary by CodeRabbit