[
https://issues.apache.org/jira/browse/FLINK-22630?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chesnay Schepler closed FLINK-22630.
------------------------------------
Resolution: Not A Problem
A bit of a weird use-case, and potentially fixed by recent bumps of okhttp in
Flink.
> Different com.squareup.okhttp3:okhttp dependency versions might lead to
> version conflicts with io.fabric8:kubernetes-server-mock
> --------------------------------------------------------------------------------------------------------------------------------
>
> Key: FLINK-22630
> URL: https://issues.apache.org/jira/browse/FLINK-22630
> Project: Flink
> Issue Type: Improvement
> Components: Build System
> Affects Versions: 1.14.0
> Reporter: Matthias
> Priority: Minor
>
> I ran into the following issue when executing {{Fabric8FlinkKubeClientTest}}
> in a test suite from a different flink module that has
> {{com.squareup.okhttp3:okhttp}} set as a dependency (more specifically in my
> case {{flink-runtime}}'s {{ZooKeeperStateHandleStoreTest}}) from within
> Intellij:
> {code}
> Exception in thread "MockWebServer" java.lang.NoSuchFieldError:
> H2_PRIOR_KNOWLEDGE
> at
> okhttp3.mockwebserver.MockWebServer$3.processConnection(MockWebServer.java:499)
> at okhttp3.mockwebserver.MockWebServer$3.execute(MockWebServer.java:443)
> at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748)
> {code}
> Interestingly, the test didn't fail when executing it from command line:
> {code}
> mvn -pl flink-runtime,flink-kubernetes test
> -Dtest=Fabric8FlinkKubeClientTest,ZooKeeperStateHandleStoreTest -Dfast
> {code}
> {{Fabric8FlinkKubeClientTest}} also doesn't fail if running multiple tests of
> {{flink-kubernetes}}.
> The issue is caused by the {{MockWebServer}} implementation. I found a hint
> on [StackOverflow|https://stackoverflow.com/a/64437318/11118339] indicating
> that {{io.fabric8:kubernetes-server-mock}} uses
> {{com.squareup.okhttp3:mockwebserver}} internally which leads to the version
> clash and the error shown above.
> I checked the other dependencies and realized that we use
> {{com.squareup.okhttp3:okhttp}} in multiple modules and that Intellij adds
> all of these dependencies versions to the classpath. My conclusion was that
> there might be a version conflict accessing the wrong dependency version when
> loading the dependencies for the test execution that results in the error
> shown above.
> I verified my finding by updating the version for all
> {{{{com.squareup.okhttp3:okhttp}} dependencies to {{1.12.6}} which is used in
> {{flink-kubernetes}} and reloaded the Maven dependencies within Intellij.
> This made the above mentioned test suite containing
> {{Fabric8FlinkKubeClientTest}} in a test suite from a different flink module
> that has {{com.squareup.okhttp3:okhttp}} and
> {{ZooKeeperStateHandleStoreTest}} succeed.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)