Skip to content

Unexpected behavior for database containers launched via JDBC URL scheme #2544

Open
@Lewox

Description

@Lewox

Version: 1.13.0
Spring Boot: yes
Container: mariadb:10.4

According to Database containers launched via JDBC URL scheme's note:
We will use /// (host-less URIs) from now on to emphasis the unimportance of the host:port pair.
From Testcontainers' perspective, jdbc:mysql:5.7.22://localhost:3306/databasename and jdbc:mysql:5.7.22:///databasename is the same URI.

This URL jdbc:tc:mariadb:10.4:///users?TC_INITSCRIPT=sql/init.sql should behave as jdbc:tc:mariadb:10.4://localhost:33306/users?TC_INITSCRIPT=sql/init.sql

The result for the first is URL is:
Waiting for database connection to become available at jdbc:mariadb://localhost:32795/test using query 'SELECT 1'

This results in failed TC_INITSCRIPT due to permissions.

For the second is:
Waiting for database connection to become available at jdbc:mariadb://localhost:32797/users using query 'SELECT 1'

This might be missing from #566 and #617.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions