Kafka
  1. Kafka
  2. KAFKA-568

LogTest started failing after KAFKA-506

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Cannot Reproduce
    • Affects Version/s: 0.8.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Not sure if this is directly related to the KAFKA-506, but the following test fails very often for me -

      [info] == core-kafka / kafka.log.LogTest ==
      [info] Test Starting: testTimeBasedLogRoll
      [error] Test Failed: testTimeBasedLogRoll
      junit.framework.AssertionFailedError: There should be exactly one segment. expected:<1> but was:<2>
      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.LogTest.testTimeBasedLogRoll(LogTest.scala:73)
      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.LogTest.run(LogTest.scala:32)
      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)
      [info] Test Starting: testSizeBasedLogRoll
      [info] Test Passed: testSizeBasedLogRoll

        Activity

        Neha Narkhede created issue -
        Hide
        Jay Kreps added a comment -

        I noticed this too. The problem seems to stem from a timing assumption in that test which no longer holds true. Let me take a look and see if there is a fundamental reason for this or it is just a bad test. Simply using our retry handler doesn't really solve the problem since the central assertion is around the time taken.

        One thing that would help a lot of these cases would be for us to make a version of KafkaScheduler that works off the Time interface, the scheduler is one of the few parts of code that is still susceptable to timing assumptions not controllable from a unit test.

        Show
        Jay Kreps added a comment - I noticed this too. The problem seems to stem from a timing assumption in that test which no longer holds true. Let me take a look and see if there is a fundamental reason for this or it is just a bad test. Simply using our retry handler doesn't really solve the problem since the central assertion is around the time taken. One thing that would help a lot of these cases would be for us to make a version of KafkaScheduler that works off the Time interface, the scheduler is one of the few parts of code that is still susceptable to timing assumptions not controllable from a unit test.
        Jay Kreps made changes -
        Field Original Value New Value
        Assignee Jay Kreps [ jkreps ]
        Hide
        Neha Narkhede added a comment -

        >> One thing that would help a lot of these cases would be for us to make a version of KafkaScheduler that works off the Time interface, the scheduler is one of the few parts of code that is still susceptable to timing assumptions not controllable from a unit test.

        +1, this was something I didn't fix when I removed the sleep statements from our unit tests.

        Show
        Neha Narkhede added a comment - >> One thing that would help a lot of these cases would be for us to make a version of KafkaScheduler that works off the Time interface, the scheduler is one of the few parts of code that is still susceptable to timing assumptions not controllable from a unit test. +1, this was something I didn't fix when I removed the sleep statements from our unit tests.
        Hide
        Neha Narkhede added a comment -

        ping

        Show
        Neha Narkhede added a comment - ping
        Neha Narkhede made changes -
        Labels bugs unit-test
        Hide
        Neha Narkhede added a comment -

        This doesn't seem to happen anymore on the 0.8 branch

        Show
        Neha Narkhede added a comment - This doesn't seem to happen anymore on the 0.8 branch
        Neha Narkhede made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Cannot Reproduce [ 5 ]
        Neha Narkhede made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Swapnil Ghike added a comment -

        It still fails intermittently on 0.8 branch, I can take a look after KAFKA-763.

        Show
        Swapnil Ghike added a comment - It still fails intermittently on 0.8 branch, I can take a look after KAFKA-763 .

          People

          • Assignee:
            Jay Kreps
            Reporter:
            Neha Narkhede
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development