Kafka
  1. Kafka
  2. KAFKA-1377

transient unit test failure in LogOffsetTest

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core
    • Labels:

      Description

      Saw the following transient unit test failure.

      kafka.server.LogOffsetTest > testGetOffsetsBeforeEarliestTime FAILED
      junit.framework.AssertionFailedError: expected:<List(0)> but was:<Vector()>
      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:71)
      at kafka.server.LogOffsetTest.testGetOffsetsBeforeEarliestTime(LogOffsetTest.scala:198)

      1. KAFKA-1377_2014-04-11_17:42:13.patch
        3 kB
        Jun Rao
      2. KAFKA-1377_2014-04-11_18:14:45.patch
        3 kB
        Jun Rao
      3. KAFKA-1377.patch
        0.7 kB
        Jun Rao

        Activity

        Hide
        Jun Rao added a comment -

        Not sure the exact cause. One potential issue that I saw is the following. We call
        waitUntilTrue(() => isLeaderLocalOnBroker(topic, part, server), 1000)
        before the assertion. However, if waitUntilTrue returns false. We proceed. We should add the assertion on waitUntilTrue and probably increase the wait time.

        Show
        Jun Rao added a comment - Not sure the exact cause. One potential issue that I saw is the following. We call waitUntilTrue(() => isLeaderLocalOnBroker(topic, part, server), 1000) before the assertion. However, if waitUntilTrue returns false. We proceed. We should add the assertion on waitUntilTrue and probably increase the wait time.
        Hide
        Jun Rao added a comment -

        Created reviewboard https://reviews.apache.org/r/20186/
        against branch origin/trunk

        Show
        Jun Rao added a comment - Created reviewboard https://reviews.apache.org/r/20186/ against branch origin/trunk
        Hide
        Jun Rao added a comment -

        Updated reviewboard https://reviews.apache.org/r/20186/
        against branch origin/trunk

        Show
        Jun Rao added a comment - Updated reviewboard https://reviews.apache.org/r/20186/ against branch origin/trunk
        Hide
        Jun Rao added a comment -

        Updated reviewboard https://reviews.apache.org/r/20186/
        against branch origin/trunk

        Show
        Jun Rao added a comment - Updated reviewboard https://reviews.apache.org/r/20186/ against branch origin/trunk
        Hide
        Jun Rao added a comment -

        Thanks for the review. Committed to trunk.

        Show
        Jun Rao added a comment - Thanks for the review. Committed to trunk.
        Hide
        Manikumar Reddy added a comment -

        LogOffsetTests are consistently failing on my machine.

        kafka.server.LogOffsetTest > testGetOffsetsBeforeLatestTime FAILED
        junit.framework.AssertionFailedError: Log for partition [topic,0] should be created
        at junit.framework.Assert.fail(Assert.java:47)
        at kafka.utils.TestUtils$.waitUntilTrue(TestUtils.scala:589)
        at kafka.server.LogOffsetTest.testGetOffsetsBeforeLatestTime(LogOffsetTest.scala:85)

        kafka.server.LogOffsetTest > testGetOffsetsBeforeEarliestTime FAILED
        junit.framework.AssertionFailedError: Leader should be elected
        at junit.framework.Assert.fail(Assert.java:47)
        at kafka.utils.TestUtils$.waitUntilTrue(TestUtils.scala:589)
        at kafka.server.LogOffsetTest.testGetOffsetsBeforeEarliestTime(LogOffsetTest.scala:188)

        kafka.server.LogOffsetTest > testEmptyLogsGetOffsets FAILED
        junit.framework.AssertionFailedError: Partition [kafka,0] metadata not propagated after 5000 ms
        at junit.framework.Assert.fail(Assert.java:47)
        at kafka.utils.TestUtils$.waitUntilTrue(TestUtils.scala:589)
        at kafka.utils.TestUtils$.waitUntilMetadataIsPropagated(TestUtils.scala:629)
        at kafka.utils.TestUtils$$anonfun$createTopic$1.apply(TestUtils.scala:174)
        at kafka.utils.TestUtils$$anonfun$createTopic$1.apply(TestUtils.scala:173)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:206)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:206)
        at scala.collection.immutable.Range$ByOne$class.foreach(Range.scala:285)
        at scala.collection.immutable.Range$$anon$2.foreach(Range.scala:265)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:206)
        at scala.collection.immutable.Range.map(Range.scala:39)
        at kafka.utils.TestUtils$.createTopic(TestUtils.scala:173)
        at kafka.server.LogOffsetTest.testEmptyLogsGetOffsets(LogOffsetTest.scala:122)

        kafka.server.LogOffsetTest > testGetOffsetsBeforeNow FAILED
        junit.framework.AssertionFailedError: Leader should be elected
        at junit.framework.Assert.fail(Assert.java:47)
        at kafka.utils.TestUtils$.waitUntilTrue(TestUtils.scala:589)
        at kafka.server.LogOffsetTest.testGetOffsetsBeforeNow(LogOffsetTest.scala:160)

        Show
        Manikumar Reddy added a comment - LogOffsetTests are consistently failing on my machine. kafka.server.LogOffsetTest > testGetOffsetsBeforeLatestTime FAILED junit.framework.AssertionFailedError: Log for partition [topic,0] should be created at junit.framework.Assert.fail(Assert.java:47) at kafka.utils.TestUtils$.waitUntilTrue(TestUtils.scala:589) at kafka.server.LogOffsetTest.testGetOffsetsBeforeLatestTime(LogOffsetTest.scala:85) kafka.server.LogOffsetTest > testGetOffsetsBeforeEarliestTime FAILED junit.framework.AssertionFailedError: Leader should be elected at junit.framework.Assert.fail(Assert.java:47) at kafka.utils.TestUtils$.waitUntilTrue(TestUtils.scala:589) at kafka.server.LogOffsetTest.testGetOffsetsBeforeEarliestTime(LogOffsetTest.scala:188) kafka.server.LogOffsetTest > testEmptyLogsGetOffsets FAILED junit.framework.AssertionFailedError: Partition [kafka,0] metadata not propagated after 5000 ms at junit.framework.Assert.fail(Assert.java:47) at kafka.utils.TestUtils$.waitUntilTrue(TestUtils.scala:589) at kafka.utils.TestUtils$.waitUntilMetadataIsPropagated(TestUtils.scala:629) at kafka.utils.TestUtils$$anonfun$createTopic$1.apply(TestUtils.scala:174) at kafka.utils.TestUtils$$anonfun$createTopic$1.apply(TestUtils.scala:173) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:206) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:206) at scala.collection.immutable.Range$ByOne$class.foreach(Range.scala:285) at scala.collection.immutable.Range$$anon$2.foreach(Range.scala:265) at scala.collection.TraversableLike$class.map(TraversableLike.scala:206) at scala.collection.immutable.Range.map(Range.scala:39) at kafka.utils.TestUtils$.createTopic(TestUtils.scala:173) at kafka.server.LogOffsetTest.testEmptyLogsGetOffsets(LogOffsetTest.scala:122) kafka.server.LogOffsetTest > testGetOffsetsBeforeNow FAILED junit.framework.AssertionFailedError: Leader should be elected at junit.framework.Assert.fail(Assert.java:47) at kafka.utils.TestUtils$.waitUntilTrue(TestUtils.scala:589) at kafka.server.LogOffsetTest.testGetOffsetsBeforeNow(LogOffsetTest.scala:160)
        Hide
        Jun Rao added a comment -

        Is this on trunk? Thanks,

        Show
        Jun Rao added a comment - Is this on trunk? Thanks,
        Hide
        Manikumar Reddy added a comment -

        Yes. I am observing these failures on trunk.

        Show
        Manikumar Reddy added a comment - Yes. I am observing these failures on trunk.
        Hide
        Neha Narkhede added a comment -

        Jun Rao, reopening this as per Manikumar Reddy's observation

        Show
        Neha Narkhede added a comment - Jun Rao , reopening this as per Manikumar Reddy 's observation
        Hide
        Guozhang Wang added a comment -

        Pushing to 0.9 as for now, Manikumar Reddy is it still a consistently reproducible issue on your side?

        Show
        Guozhang Wang added a comment - Pushing to 0.9 as for now, Manikumar Reddy is it still a consistently reproducible issue on your side?
        Hide
        Manikumar Reddy added a comment -

        Yes, these failures are consistent on my machine.

        My machine configuration: 32 bit Ubuntu OS, i5 processor, 4GB

        Show
        Manikumar Reddy added a comment - Yes, these failures are consistent on my machine. My machine configuration: 32 bit Ubuntu OS, i5 processor, 4GB
        Hide
        Manikumar Reddy added a comment -

        now i am not getting this exception..so closing the issue.

        Show
        Manikumar Reddy added a comment - now i am not getting this exception..so closing the issue.
        Hide
        Pierre-Yves Ritschard added a comment -

        I am getting these errors consistently.
        This is against trunk on Linux. 64 bit, i7 processor 16G. JDK version:

        java version "1.8.0_60"
        Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
        Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

        Show
        Pierre-Yves Ritschard added a comment - I am getting these errors consistently. This is against trunk on Linux. 64 bit, i7 processor 16G. JDK version: java version "1.8.0_60" Java(TM) SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
        Hide
        Pierre-Yves Ritschard added a comment -

        FWIW, bumping the waitTime parameter in TestUtils.scala does not change the behavior, so this is not timing related (waiting for 15s instead of 5s still exhibits the same behavior).

        Show
        Pierre-Yves Ritschard added a comment - FWIW, bumping the waitTime parameter in TestUtils.scala does not change the behavior, so this is not timing related (waiting for 15s instead of 5s still exhibits the same behavior).
        Hide
        Guozhang Wang added a comment -

        Pierre-Yves Ritschard Which Kafka version are you running for these tests?

        Show
        Guozhang Wang added a comment - Pierre-Yves Ritschard Which Kafka version are you running for these tests?
        Hide
        Pierre-Yves Ritschard added a comment - - edited

        Guozhang Wang I'm testing against trunk.
        The failure to propagater results is confined to the Sasl tests.

        Show
        Pierre-Yves Ritschard added a comment - - edited Guozhang Wang I'm testing against trunk. The failure to propagater results is confined to the Sasl tests.
        Hide
        Ismael Juma added a comment -

        Pierre-Yves Ritschard, this JIRA is about LogOffsetTest, if you are seeing other failures (ie Sasl related), please file a separate issue (in case it hasn't been filed already).

        Show
        Ismael Juma added a comment - Pierre-Yves Ritschard , this JIRA is about LogOffsetTest, if you are seeing other failures (ie Sasl related), please file a separate issue (in case it hasn't been filed already).
        Hide
        Pierre-Yves Ritschard added a comment -

        Ismael Juma will do. it looked to me as a generalization of the previous problem.

        Show
        Pierre-Yves Ritschard added a comment - Ismael Juma will do. it looked to me as a generalization of the previous problem.
        Hide
        Guozhang Wang added a comment -

        Ismael Juma Is this still an issue? I cannot remember seeing this failure in recent Jenkins builds.

        Show
        Guozhang Wang added a comment - Ismael Juma Is this still an issue? I cannot remember seeing this failure in recent Jenkins builds.
        Hide
        Ismael Juma added a comment -

        I haven't seen it, so closing it since the original reporter said it was fixed.

        Show
        Ismael Juma added a comment - I haven't seen it, so closing it since the original reporter said it was fixed.

          People

          • Assignee:
            Jun Rao
            Reporter:
            Jun Rao
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development