testcontainers / testcontainers/testcontainers-java

[Bug]: [MariaDB] getLivenessCheckPortNumbers incorrectly implemented

Open
#10,359 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/bug
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

Module

MariaDB

Testcontainers version

1.21.1

Problem at least present since 1.16.0

Using the latest Testcontainers version?

Yes

What happened?

https://github.com/testcontainers/testcontainers-java/blob/7d8301903a6b45591605fd376702d24fc878a61d/modules/mariadb/src/main/java/org/testcontainers/containers/MariaDBContainer.java#L64-L66

The MAPPED port is NOT returned, which causes the HostPortWaitStrategy to fail.

Why does this method exists in the first place? I couldn't find why it even exists. The super Method should work just fine.

Additional Information

This is part of a general performance regression in JDBC containers (waitUntilContainerStarted), that I'm currently addressing. I will create some follow up issues too describe the problem/s in more detail soon.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in modules/mariadb/src/main/java/org/testcontainers/containers/MariaDBContainer.java at getLivenessCheckPortNumbers, then compare it with the superclass method and the HostPortWaitStrategy behavior. Confirm the mapped port is handled consistently and verify that waitUntilContainerStarted succeeds for the MariaDB container.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java, mariadb
Domain
databases, testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.