Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
0.7
-
None
-
None
Description
On a fresh checkout and with an empty .ivy2 and .m2 cache, if you execute ./sbt update test, the integration tests will fail with this error -
java.lang.NoSuchMethodError: junit.framework.TestSuite.<init>([Ljava/lang/Class;)V
at org.scalatest.junit.JUnit3Suite.run(JUnit3Suite.scala:309)
at org.scalatest.tools.ScalaTestFramework$ScalaTestRunner.run(ScalaTestFramework.scala:40)
at sbt.TestRunner.run(TestFramework.scala:53)
at sbt.TestRunner.runTest$1(TestFramework.scala:67)
at sbt.TestRunner.run(TestFramework.scala:76)
at sbt.TestFramework$$anonfun$10$$anonfun$apply$11.runTest$2(TestFramework.scala:194)
at sbt.TestFramework$$anonfun$10$$anonfun$apply$11$$anonfun$apply$12.apply(TestFramework.scala:205)
at sbt.TestFramework$$anonfun$10$$anonfun$apply$11$$anonfun$apply$12.apply(TestFramework.scala:205)
at sbt.NamedTestTask.run(TestFramework.scala:92)
at sbt.ScalaProject$$anonfun$sbt$ScalaProject$$toTask$1.apply(ScalaProject.scala:193)
at sbt.ScalaProject$$anonfun$sbt$ScalaProject$$toTask$1.apply(ScalaProject.scala:193)
at sbt.TaskManager$Task.invoke(TaskManager.scala:62)
at sbt.impl.RunTask.doRun$1(RunTask.scala:77)
at sbt.impl.RunTask.runTask(RunTask.scala:85)
at sbt.impl.RunTask.sbt$impl$RunTask$$runIfNotRoot(RunTask.scala:60)
at sbt.impl.RunTask$$anonfun$runTasksExceptRoot$2.apply(RunTask.scala:48)
at sbt.impl.RunTask$$anonfun$runTasksExceptRoot$2.apply(RunTask.scala:48)
at sbt.Distributor$Run$Worker$$anonfun$2.apply(ParallelRunner.scala:131)
at sbt.Distributor$Run$Worker$$anonfun$2.apply(ParallelRunner.scala:131)
at sbt.Control$.trapUnit(Control.scala:19)
at sbt.Distributor$Run$Worker.run(ParallelRunner.scala:131)
The reason being 2 versions of the junit jar on the test classpath that SBT uses to run the "test" command. The KafkaProject.scala file corrects defines one of the test dependencies to be junit-4.1, since it uses a JUnit api in some of the tests. The problem is that there is another junit jar (v3.8.1) which gets downloaded as a transitive dependency on Scala 2.8.0. The cause of the above error is an incorrect test classpath, that includes both v4.1 as well as v3.8.1.
One of the possible fixes is to override the "testClasspath" variable in SBT to explicitly exclude junit from directories other than core/lib_managed/test
Attachments
Attachments
Issue Links
- is broken by
-
KAFKA-92 upgrade to latest stable 0.7.x sbt
- Resolved