Bug: Flaky test: org.apache.spark.sql.hive.thriftserver.HiveSessionImplSuite.(It is not a test it is a sbt.testing.SuiteSelector)
Status: Resolved | Priority: Major | Resolution: Fixed
Created: 27/May/20 05:04
Affects Version/s: 3.1.0

I've seen the failures two times (not in a row but closely) which seems to require investigation.

https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/123147/testReport
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/123150/testReport

{noformat}
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@483bf400'   created class : 'org.mockito.codegen.SessionManager$MockitoMock$1696557705', loaded by classloader : 'net.bytebuddy.dynamic.loading.MultipleParentClassLoader@47ecf2c6'   proxy instance class : 'org.mockito.codegen.SessionManager$MockitoMock$1696557705', loaded by classloader : 'net.bytebuddy.dynamic.loading.MultipleParentClassLoader@47ecf2c6'   instance creation by : ObjenesisInstantiator  You might experience classloading issues, please ask the mockito mailing-list. 
 Stack Trace
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@483bf400'
  created class : 'org.mockito.codegen.SessionManager$MockitoMock$1696557705', loaded by classloader : 'net.bytebuddy.dynamic.loading.MultipleParentClassLoader@47ecf2c6'
  proxy instance class : 'org.mockito.codegen.SessionManager$MockitoMock$1696557705', loaded by classloader : 'net.bytebuddy.dynamic.loading.MultipleParentClassLoader@47ecf2c6'
  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$1696557705 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
{noformat}