testcontainers / testcontainers/testcontainers-java

MySQL: failure is reported as success

Open
#1,846 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The following code:

new MySQLContainer<>()
            .withUsername("root")

fails with STDERR: ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'root'@'%' but then:

18:38:14.158 INFO  🐳 [mysql:5.7.22] - Container is started (JDBC URL: jdbc:mysql://localhost:32775/test)
18:38:14.159 INFO  🐳 [mysql:5.7.22] - Container mysql:5.7.22 started

it may be caused by #1434, need investigation

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

Reproduce the issue with MySQLContainer and withUsername("root"), then read the startup path and investigate the suspected connection to issue #1434. Confirm where the MySQL CREATE USER failure is handled and make the completed behavior report that failure instead of reporting a started container.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java, mysql
Domain
databases, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.