quarkus: QuarkusIntegrationTest fails with ClassCastException

Describe the bug

@QuarkusIntegrationTest may fail with the following exception

java.lang.RuntimeException: java.lang.ClassCastException: class io.quarkus.test.junit.RunningAppConfigResolver$1 cannot be cast to class io.smallrye.config.SmallRyeConfig (io.quarkus.test.junit.RunningAppConfigResolver$1 and io.smallrye.config.SmallRyeConfig are in unnamed module of loader 'app')
Caused by: java.lang.ClassCastException: class io.quarkus.test.junit.RunningAppConfigResolver$1 cannot be cast to class io.smallrye.config.SmallRyeConfig (io.quarkus.test.junit.RunningAppConfigResolver$1 and io.smallrye.config.SmallRyeConfig are in unnamed module of loader 'app')

Expected behavior

No exception, test just work.

Actual behavior

The exception is thrown, test is failing.

How to Reproduce?

IT test annotated with @QuarkusTest works without any problems but it executes everything in the same JVM. Once it changed to @QuarkusIntegrationTest sometimes it may throw this exception. Sometimes the test refuses to start Quarkus because the port is occupied (may be it has not been shutdown properly after the previous run ?)

Output of uname -a or ver

Linux, version 4.14.225-169.362.amzn2.x86_64

Output of java -version

Java 8

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.3.0.Final

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

Upgraded Quarkus version to 2.3.0 where this fix is done : https://github.com/quarkusio/quarkus/issues/20049

Now the tests are executed somehow but some tests are failing.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

NativeAccountResourceTest should be renamed to NativeAccountResourceIT

It did work prior to 2.3.0.Final though. Was that a missing restriction in there? So It’s not intended to run anything other than @QuarkusIntegrationTest in the failsafe mvn verify in general or is that some restriction that could be changed?

If it worked, it worked by chance.

So It’s not intended to run anything other than @QuarkusIntegrationTest in the failsafe mvn verify in general

Correct

Sorry, I don’t have the localized simple project for this. It happened here https://github.com/vaadin/quarkus within the ITs: https://github.com/vaadin/quarkus/tree/master/integration-tests/development this commit should fix the problem : https://github.com/vaadin/quarkus/pull/39/commits/74ef495ee4b8ad3b8e9b2bd277062909a1ad9aad but this PR without this commit is failing : https://github.com/vaadin/quarkus/pull/39