Skip to content

Fix ScriptUtils.runInitScript() in hierarchical classloader setup by using TCCL - #5167

Merged
kiview merged 1 commit into
testcontainers:masterfrom
famod:scriptutils-classloading
Apr 6, 2022
Merged

kiview merged 1 commit into
testcontainers:masterfrom
famod:scriptutils-classloading

Conversation

@famod

@famod famod commented Mar 9, 2022

Copy link
Copy Markdown
Contributor

This fixes e.g. MariaDBContainer.withInitScript(...) in Quarkus continuous testing, which is using a hierarchical classloading setup.

Btw, for comparison, MountableFile (e.g. MariaDBContainer.withConfigurationOverride(...)) does work already:

classLoadersToSearch.add(Thread.currentThread().getContextClassLoader());

@famod
famod requested review from bsideup, kiview and rnorth as code owners March 9, 2022 16:43
@famod

famod commented Mar 9, 2022

Copy link
Copy Markdown
Contributor Author

FYI @stuartwdouglas @geoand 🔝

@geoand

geoand commented Mar 9, 2022

Copy link
Copy Markdown
Contributor

👌

@famod

famod commented Apr 4, 2022

Copy link
Copy Markdown
Contributor Author

@rnorth @bsideup @kiview can you have a look please? Thanks!

@kiview

kiview commented Apr 4, 2022

Copy link
Copy Markdown
Member

@famod Thanks for the ping, we'll have a look at it 🙂

@kiview

kiview commented Apr 4, 2022

Copy link
Copy Markdown
Member

@famod Can you please explain how to reproduce the issue with Quarkus continuous testing, or share a reproducer?

@bsideup

bsideup commented Apr 4, 2022

Copy link
Copy Markdown
Member

I don't think we need Quarkus to test this, just a simple test should be added to the PR that ensures that the code takes context's classloader into the consideration 👍

@famod

famod commented Apr 5, 2022 •

Copy link
Copy Markdown
Contributor Author

I'll have a look. As I have a lot on my plate: Is there any ETA for the next TC release?

@kiview

kiview commented Apr 6, 2022

Copy link
Copy Markdown
Member

@famod We are currently in the process of preparing the next release. So having the test could help with getting this PR into the upcoming release.

@bsideup bsideup added this to the next milestone Apr 6, 2022
@kiview
kiview merged commit 06fc95f into testcontainers:master Apr 6, 2022
@famod
famod deleted the scriptutils-classloading branch April 6, 2022 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants