testcontainers / testcontainers/testcontainers-java

ContainerDatabaseDriver could use its own ClassLoader

Open
#3,735 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Basic ServiceLoader#load() signature uses Thread#currentThread()#getContextClassLoader(), which doesn't account for situations where ContainerDatabaseDriver has been provided in a modular fashion. It seems reasonable to require that the various JdbcDatabaseContainerProvider implementations live in the same ClassLoader as the driver class itself.

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

Locate ContainerDatabaseDriver and inspect its ServiceLoader#load() call, along with the JdbcDatabaseContainerProvider loading path. Check how the driver class loader and the thread context class loader differ in modular setups. Done means providers are loaded from the driver’s class loader and regression coverage verifies that behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.