kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neha Narkhede <neha.narkh...@gmail.com>
Subject Re: broken unit tests, on a fresh checkout
Date Thu, 06 Oct 2011 00:04:12 GMT
We think we have an explanation for this behavior.

On Oct 3 evening, Chris updated the SBT version to 0.7.7. In that
version, it pulls in the transitive dependencies of Scala 2.8.0 (Scala
2.8.0 -> Jline 0.9.91 -> Junit 3.8.1).
In SBT 0.7.5 however, it doesn't pull in those transitive dependencies
of Scala 2.8.0.

There is a bug in SBT <= 0.7.7 where it includes project/boot on the
run classpath, and there seems to be no way of avoiding this. Due to
this, there are 2 versions of junit on the test classpath,
and our integration tests fail.

For the short term, we will revert to SBT 0.7.5, where we will not hit
this problem. However, it will be great to resolve
https://issues.apache.org/jira/browse/KAFKA-134

Thanks,
Neha

On Tue, Oct 4, 2011 at 6:32 PM, Neha Narkhede <neha.narkhede@gmail.com> wrote:
> I found that this is indeed a problem caused due to multiple versions
> of the junit jar on the test classpath used by SBT.
>
> Have filed a blocker bug to track this -
> https://issues.apache.org/jira/browse/KAFKA-147
>
> The open question is though, how we didn't run into this earlier. The
> Scala 2.8.0 compiler has been depending on jline 0.9.91 since July
> 2010, and jline 0.9.91 has been depending on junit 3.8.1 since 2007.
>
> Can anyone else think of an explanation ?
>
> Thanks,
> Neha
>
> On Tue, Oct 4, 2011 at 4:39 PM, Neha Narkhede <neha.narkhede@gmail.com> wrote:
>> Hi,
>>
>> I see that some unit tests are failing with NoSuchMethodError, on a
>> fresh checkout of Kafka. This is what I did after the checkout
>>
>> ./sbt update test
>>
>> Some tests repeatedly fail with this error -
>>
>> [info] == core-kafka / kafka.javaapi.integration.PrimitiveApiTest ==
>> 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)
>> [error] Could not run test kafka.javaapi.integration.PrimitiveApiTest:
>> java.lang.NoSuchMethodError:
>> junit.framework.TestSuite.<init>([Ljava/lang/Class;)V
>>
>> I wonder if this is due to multiple versions of scalatest on the
>> classpath. Does anyone else see this ?
>>
>> Thanks,
>> Neha
>>
>

Mime
View raw message