quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.57k stars 2.63k forks source link

NPE in QuarkusTestExtension.runExtensionMethod following CL issue #42609

Open gsmet opened 1 month ago

gsmet commented 1 month ago

While the issue is a bit out of the ordinary, I think there's something we need to fix here.

2024-08-16T20:30:22.9787891Z    Suppressed: java.lang.NullPointerException: Cannot invoke "io.quarkus.bootstrap.app.RunningQuarkusApplication.getClassLoader()" because "io.quarkus.test.junit.QuarkusTestExtension.runningQuarkusApplication" is null
2024-08-16T20:30:22.9790491Z        at io.quarkus.test.junit.QuarkusTestExtension.runExtensionMethod(QuarkusTestExtension.java:920)
2024-08-16T20:30:22.9792389Z        at io.quarkus.test.junit.QuarkusTestExtension.runExtensionMethod(QuarkusTestExtension.java:912)
2024-08-16T20:30:22.9794109Z        at io.quarkus.test.junit.QuarkusTestExtension.interceptAfterAllMethod(QuarkusTestExtension.java:906)
2024-08-16T20:30:22.9795480Z        at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
2024-08-16T20:30:22.9796655Z        at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1092)
2024-08-16T20:30:22.9797664Z        ... 1 more
gsmet commented 4 weeks ago

I think we should take failedBoot into account in all these intercept methods. Now what I'm not sure of is if we should plain return if failedBoot is true or if we should proceed with the call without setting up the CL.

Let's discuss it with @geoand when he's back.

famod commented 3 weeks ago

Sounds a lot like #33371

geoand commented 3 weeks ago

Seems exactly like #33371 actually, which IIRC I unfortunately could not reproduce.