camel-quarkus icon indicating copy to clipboard operation
camel-quarkus copied to clipboard

kubernetes: testKubernetesComponent is failing on the quarkus-platform

Open aldettinger opened this issue 1 year ago • 5 comments

Bug description

While releasing Camel Quarkus 3.8.0, test below was failing:

  • org.apache.camel.quarkus.component.kubernetes.it.KubernetesTest.testKubernetesComponent
java.lang.RuntimeException: java.lang.NoSuchMethodError: 'void okhttp3.internal.Internal.initializeInstanceForTests()'
	at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:638)
	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestClassConstructor(QuarkusTestExtension.java:722)
	at java.base/java.util.Optional.orElseGet(Optional.java:364)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: java.lang.NoSuchMethodError: 'void okhttp3.internal.Internal.initializeInstanceForTests()'
	at okhttp3.mockwebserver.MockWebServer.<clinit>(MockWebServer.java:103)

aldettinger avatar Feb 26 '24 09:02 aldettinger

See https://github.com/apache/camel-quarkus/pull/5806.

jamesnetherton avatar Feb 27 '24 12:02 jamesnetherton

I'll close this, as the test is passing again thanks to some dependency overrides. And we have added a permanent fix in #5806.

jamesnetherton avatar Feb 28 '24 10:02 jamesnetherton

Reopening because my 'fix' actually didn't do anything, since the problem mockwebserver dependency isn't actually getting added to the BOM 🤦.

jamesnetherton avatar Mar 18 '24 07:03 jamesnetherton

@jamesnetherton this line in quarkus-platform https://github.com/quarkusio/quarkus-platform/blob/3.8/pom.xml#L385-L386 could be removed?

zhfeng avatar Apr 15 '24 14:04 zhfeng

@jamesnetherton this line in quarkus-platform https://github.com/quarkusio/quarkus-platform/blob/3.8/pom.xml#L385-L386 could be removed?

No, I don't think so. While mockwebserver is not in our BOM and the k8s client still aligns with okhttp 3.x, the dependency tree ends up being a mess when tests run because IIRC the universe BOM is used:

https://github.com/quarkusio/quarkus-platform/blob/3.8/generated-platform-project/quarkus-universe/bom/pom.xml

jamesnetherton avatar Apr 15 '24 14:04 jamesnetherton

Seems to work as of Camel Quarkus 3.15.0

ppalaga avatar Sep 23 '24 11:09 ppalaga