-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No suitable driver found for Postgresql with TestContainers since Quarkus 1.8 #12116
Comments
@gsmet does this ring a bell? |
No. It doesn't. Given there's nothing Quarkus in it, I don't think it's related to any of my changes. @agoncal please provide a reproducer. Going through steps is cumbersome and generates unnecessary noise. Thanks. |
Yeah, the reproducer also makes it trivial to actually debug and compare between the 2 versions. But my guess is that if it worked before, it was mostly by accident. |
Here it is : https://github.com/agoncal/agoncal-bug-quarkus-testcontainers It is the exact same code. The only thing that changes is the Quarkus version. If you run a |
I can reproduce the issue. I wonder if it could be a CL issue as I don't see how other changes could be related to that considering how level this is. @stuartwdouglas does it ring a bell? |
The act of clearing the manager could result in the drivers being initialized, which can change the runtime behaviour. Fixes quarkusio#12116
This will work if you call DriverManager.getDrivers() before the getConnection call. Weirdly it will also work if you try and call getConnection a second time. The root cause of this is the DriverRemover, which calls getDriver and initializes it with a ClassLoader that is being closed. |
Hum... I've tried to invoke |
The act of clearing the manager could result in the drivers being initialized, which can change the runtime behaviour. Fixes quarkusio#12116
The act of clearing the manager could result in the drivers being initialized, which can change the runtime behaviour. Fixes quarkusio#12116
Just tested with Quarkus 1.8.2 and its ok now. |
Describe the bug
I have a TestContainers test that pings a Postgres DB. This test does not actually use Quarkus but I realized that it was working in 1.7.3 and failing in 1.8.
It is not a stopper for me (as I said, I realized I should have taken the
@QuarkusTest
annotation) but it sounds that something has been introduced that it makes this test fail (this test has been working since Quarkus 1.6 at least).Expected behavior
The test should pass as in 1.7.3
Actual behavior
The test fail with:
To Reproduce
Generate a brand new Quarkus 1.7.3-Final app with the Postgres extension. Then, add the TestContainers dependency:
Now create a new Test
This test just uses TestContainers to ping a Postgres db. It doesn't use any Quarkus. In fact, if you leave the
@QuarkusTest
annotation it also works. Then, move to Quarkus 1.8.0, it fails.Configuration
The test with 1.7.3 works even without any
application.properties
file declaring a Postgres driver or JDBC URL.Because it is now failing with 1.8 I tried to add
quarkus.datasource.db-kind=postgresql
and so on.Environment (please complete the following information):
uname -a
orver
: Darwin iMac-Pro-de-Antonio.local 19.6.0 Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64java -version
: java version "11.0.6" 2020-01-14 LTSmvnw --version
orgradlew --version
): 3.6.3_1Additional context
(Add any other context about the problem here.)
The text was updated successfully, but these errors were encountered: