HeartSaVioR commented on pull request #29039:
URL: https://github.com/apache/spark/pull/29039#issuecomment-655497019
Rationalization: the failures always come from classloader issue;
```
sbt.ForkMain$ForkError: org.mockito.exceptions.base.MockitoException:
ClassCastException occurred while creating the mockito mock :
class to mock : 'org.apache.hive.service.cli.session.SessionManager',
loaded by classloader : 'sun.misc.Launcher$AppClassLoader@2d6d8735'
created class :
'org.mockito.codegen.SessionManager$MockitoMock$2028320452', loaded by
classloader : 'net.bytebuddy.dynamic.loading.MultipleParentClassLoader@4058f9df'
proxy instance class :
'org.mockito.codegen.SessionManager$MockitoMock$2028320452', loaded by
classloader : 'net.bytebuddy.dynamic.loading.MultipleParentClassLoader@4058f9df'
instance creation by : ObjenesisInstantiator
You might experience classloading issues, please ask the mockito
mailing-list.
at
org.apache.spark.sql.hive.thriftserver.HiveSessionImplSuite.beforeAll(HiveSessionImplSuite.scala:44)
at
org.scalatest.BeforeAndAfterAll.liftedTree1$1(BeforeAndAfterAll.scala:212)
at org.scalatest.BeforeAndAfterAll.run(BeforeAndAfterAll.scala:210)
at org.scalatest.BeforeAndAfterAll.run$(BeforeAndAfterAll.scala:208)
at org.apache.spark.SparkFunSuite.run(SparkFunSuite.scala:59)
at
org.scalatest.tools.Framework.org$scalatest$tools$Framework$$runSuite(Framework.scala:317)
at
org.scalatest.tools.Framework$ScalaTestTask.execute(Framework.scala:510)
at sbt.ForkMain$Run$2.call(ForkMain.java:296)
at sbt.ForkMain$Run$2.call(ForkMain.java:286)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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)
Caused by: sbt.ForkMain$ForkError: java.lang.ClassCastException:
org.mockito.codegen.SessionManager$MockitoMock$2028320452 cannot be cast to
org.mockito.internal.creation.bytebuddy.MockAccess
at
org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker.createMock(SubclassByteBuddyMockMaker.java:48)
at
org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker.createMock(ByteBuddyMockMaker.java:25)
at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:35)
at org.mockito.internal.MockitoCore.mock(MockitoCore.java:63)
at org.mockito.Mockito.mock(Mockito.java:1908)
at org.mockito.Mockito.mock(Mockito.java:1817)
... 13 more
```
while I don't have clear idea what is happening, there's no part possibly
dealing with classloader, except initializing `HiveSessionImpl` (only suspect,
no clear evidence yet). This patch is to verify the idea that mocking instances
before initializing HiveSessionImpl would avoid the classloader issue.
It's less flaky then CliSuite and only checked once per build, so to verify
multiple times I just create 9 duplicated suites to test 10 times per build.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]