Skip to content
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

Continuous testing fails to run any tests due to ClassNotFoundException #21355

Closed
famod opened this issue Nov 10, 2021 · 2 comments · Fixed by #22336
Closed

Continuous testing fails to run any tests due to ClassNotFoundException #21355

famod opened this issue Nov 10, 2021 · 2 comments · Fixed by #22336
Labels

Comments

@famod
Copy link
Member

famod commented Nov 10, 2021

Describe the bug

I'm getting the following exception when resuming/running tests:

2021-11-10 23:43:55,103 ERROR [io.qua.test] (Test runner thread) Internal error running tests: java.lang.RuntimeException: org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-jupiter' failed to discover tests
        at io.quarkus.deployment.dev.testing.JunitTestRunner.prepare(JunitTestRunner.java:416)
        at io.quarkus.deployment.dev.testing.ModuleTestRunner.prepare(ModuleTestRunner.java:83)
        at io.quarkus.deployment.dev.testing.TestSupport.runInternal(TestSupport.java:335)
        at io.quarkus.deployment.dev.testing.TestSupport$2.run(TestSupport.java:294)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-jupiter' failed to discover tests
        at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:160)
        at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverSafely(EngineDiscoveryOrchestrator.java:134)
        at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:108)
        at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:80)
        at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:110)
        at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:78)
        at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.discover(DefaultLauncherSession.java:81)
        at org.junit.platform.launcher.core.SessionPerRequestLauncher.discover(SessionPerRequestLauncher.java:46)
        at io.quarkus.deployment.dev.testing.JunitTestRunner.prepare(JunitTestRunner.java:179)
        ... 4 more
Caused by: org.junit.platform.commons.JUnitException: ClassSelector [className = 'de.somecompany.someproject.register.tsp.connector.TspWebServiceTspConnectorTest'] resolution failed
        at org.junit.platform.launcher.listeners.discovery.AbortOnFailureLauncherDiscoveryListener.selectorProcessed(AbortOnFailureLauncherDiscoveryListener.java:39)
        at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:102)
        at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:82)
        at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:113)
        at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:46)
        at org.junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:69)
        at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:152)
        ... 12 more
Caused by: java.lang.NoClassDefFoundError: de/tsystems/mms/someproject/register/persistence/entity/SomeKey
        at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
        at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3402)
        at java.base/java.lang.Class.privateGetPublicMethods(Class.java:3427)
        at java.base/java.lang.Class.privateGetPublicMethods(Class.java:3439)
        at java.base/java.lang.Class.getMethods(Class.java:2019)
        at org.junit.platform.commons.util.ReflectionUtils.getDefaultMethods(ReflectionUtils.java:1518)
        at org.junit.platform.commons.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:1491)
        at org.junit.platform.commons.util.ReflectionUtils.findMethod(ReflectionUtils.java:1341)
        at org.junit.platform.commons.util.ReflectionUtils.isMethodPresent(ReflectionUtils.java:1242)
        at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.hasTestOrTestFactoryOrTestTemplateMethods(IsTestClassWithTests.java:50)
        at org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests.test(IsTestClassWithTests.java:46)
        at org.junit.jupiter.engine.discovery.ClassSelectorResolver.resolve(ClassSelectorResolver.java:67)
        at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolve$2(EngineDiscoveryRequestResolution.java:134)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1602)
        at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
        at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647)
        at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:185)
        at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:125)
        at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:91)
        ... 17 more
Caused by: java.lang.ClassNotFoundException: de.somecompany.someproject.register.persistence.entity.SomeKey
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:429)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:405)
        ... 42 more

SomeKey is just an @Embeddable from our register-core module. Dev mode is started in the register-server module and we have 6 other modules that the server module depends on as well.

I tried continuous testing various times before 2.4 and got similar exceptions, but mentioning other classes.
But since before 2.4 there was no way to run tests from upstream modules (and our server module has no own tests), the setup was a bit different there; dev mode was run in other modules that had test-jars in the mix, which is probably not directly comparable.

Expected behavior

No exceptions, test should be executed.

Actual behavior

ClassNotFoundException

How to Reproduce?

So far I have been unable to reproduce this with smaller setups and my project is closed source.

@stuartwdouglas asked me to create an issue regardless: https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/PR.20Review/near/255134078

Output of uname -a or ver

Linux XXX 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

OpenJDK 64-Bit Server VM Zulu17.30+15-CA (build 17.0.1+12-LTS, mixed mode, sharing) (also happened with Java 11)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.4.1.Final

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

Apache Maven 3.8.1

Additional information

No response

@famod famod added the kind/bug Something isn't working label Nov 10, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Nov 10, 2021

/cc @stuartwdouglas

@quarkus-bot
Copy link

quarkus-bot bot commented Nov 10, 2021

You added a link to a Zulip discussion, please make sure the description of the issue is comprehensive and doesn't require accessing Zulip.

This message is automatically generated by a bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant