+1 I think one of the problems we have had is the difficulty of "mocking" zookeeper. I.e. zk is a complicated enough thing that unless you run against the real thing it is unclear what you are really testing.
But I agree that these very complex junit tests that bring up the whole server and contain all kinds of sleep statements and timing assumptions are very problematic. One solution would be to concentrate on a seperate approach to integration tests that drive off the command line utilities rather than junit. The problem with junit integration tests is they tend to be both fragile and unrealistic. Full integration tests that actually bring up brokers may be fragile but at least are 100% realistic. These could be separated out and run against a dedicated hw pool and used for a set of performance and correctness scenarios. I think this is one of the core problems of this type of system--how to do good, realistic distributed testing. I have not seen anyone really succeed except via the "throw production load at it and see" approach so I would be interested to hear people's thoughts. -Jay On Tue, Nov 29, 2011 at 7:15 PM, Taylor Gautier <tgaut...@tagged.com> wrote: > Just one? :-) > > Ok - not fair I know - but I have all kinds of weird behavior with the > zookeeper tests. > > This makes it hard to develop because it's really difficult to > distinguish the signal from the noise. > > It's really important that tests pass reliably. What's the status of > your issue and the zookeeper ones? > > My team is beginning to work on some core features within Kafka as you > know and this gets in our way for implementation. > > I think it should be a high priority to eliminate these issues. > > On Nov 29, 2011, at 3:23 PM, Neha Narkhede <neha.narkh...@gmail.com> > wrote: > > > Hi, > > > > I moved to linux and one unit test consistently fails - > > > > [error] Test Failed: testCleanupExpiredSegments > > junit.framework.AssertionFailedError: Now there should only be only one > > segment. expected:<1> but was:<12> > > at junit.framework.Assert.fail(Assert.java:47) > > at junit.framework.Assert.failNotEquals(Assert.java:277) > > at junit.framework.Assert.assertEquals(Assert.java:64) > > at junit.framework.Assert.assertEquals(Assert.java:195) > > at > > > kafka.log.LogManagerTest.testCleanupExpiredSegments(LogManagerTest.scala:87) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:597) > > at > > > org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) > > at > > > org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) > > at > > > org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) > > at > > > org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) > > at > > org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) > > at > > > org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71) > > at > > > org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) > > at > > > org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) > > at > > > org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) > > at > > org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) > > at > > org.junit.internal.runners.CompositeRunner.run(CompositeRunner.java:29) > > at org.junit.runner.JUnitCore.run(JUnitCore.java:121) > > at org.junit.runner.JUnitCore.run(JUnitCore.java:100) > > at org.junit.runner.JUnitCore.run(JUnitCore.java:91) > > at org.scalatest.junit.JUnitSuite$class.run(JUnitSuite.scala:261) > > at kafka.log.LogManagerTest.run(LogManagerTest.scala:28) > > 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) > > > > Wanted to check if others run into this as well ? > > > > Thanks, > > Neha >