[ https://issues.apache.org/jira/browse/KAFKA-2055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14627041#comment-14627041 ]
Guozhang Wang commented on KAFKA-2055: -------------------------------------- [~lvfangmin] Thanks for the patch, I agree this is a common scenario that the test could fail. More generally, during a leader migration, the HW of the partition may "go back" a little bit on the new leader before it catch up to the old value and move forward. And since we use HW to guard the Fetch / ListOffset requests from clients, it could cause unexpected behaviors like above. As for fixing this test itself, I think adding some timing manner is OK; just that it would better to use the {code} TestUtils.waitUntilTrue(condition: () => Boolean, msg: String, waitTime: Long = 5000L) {code} instead of Thread.sleep(). [~hachikuji] can help reviewing the next patch if you have time, or we can also go ahead and fix it right away. For fixing this issue in a general way, I have created KAFKA-2334 along with a possible solution. > ConsumerBounceTest.testSeekAndCommitWithBrokerFailures transient failure > ------------------------------------------------------------------------ > > Key: KAFKA-2055 > URL: https://issues.apache.org/jira/browse/KAFKA-2055 > Project: Kafka > Issue Type: Sub-task > Reporter: Guozhang Wang > Assignee: Fangmin Lv > Labels: newbie > Attachments: KAFKA-2055.patch > > > {code} > kafka.api.ConsumerBounceTest > testSeekAndCommitWithBrokerFailures FAILED > java.lang.AssertionError: expected:<1000> but was:<976> > at org.junit.Assert.fail(Assert.java:92) > at org.junit.Assert.failNotEquals(Assert.java:689) > at org.junit.Assert.assertEquals(Assert.java:127) > at org.junit.Assert.assertEquals(Assert.java:514) > at org.junit.Assert.assertEquals(Assert.java:498) > at > kafka.api.ConsumerBounceTest.seekAndCommitWithBrokerFailures(ConsumerBounceTest.scala:117) > at > kafka.api.ConsumerBounceTest.testSeekAndCommitWithBrokerFailures(ConsumerBounceTest.scala:98) > kafka.api.ConsumerBounceTest > testSeekAndCommitWithBrokerFailures FAILED > java.lang.AssertionError: expected:<1000> but was:<913> > at org.junit.Assert.fail(Assert.java:92) > at org.junit.Assert.failNotEquals(Assert.java:689) > at org.junit.Assert.assertEquals(Assert.java:127) > at org.junit.Assert.assertEquals(Assert.java:514) > at org.junit.Assert.assertEquals(Assert.java:498) > at > kafka.api.ConsumerBounceTest.seekAndCommitWithBrokerFailures(ConsumerBounceTest.scala:117) > at > kafka.api.ConsumerBounceTest.testSeekAndCommitWithBrokerFailures(ConsumerBounceTest.scala:98) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)