[
https://issues.apache.org/jira/browse/KAFKA-13966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Josep Prat reopened KAFKA-13966:
--------------------------------
> Flaky test `QuorumControllerTest.testUnregisterBroker`
> ------------------------------------------------------
>
> Key: KAFKA-13966
> URL: https://issues.apache.org/jira/browse/KAFKA-13966
> Project: Kafka
> Issue Type: Bug
> Reporter: Jason Gustafson
> Assignee: David Arthur
> Priority: Major
>
> We have seen the following assertion failure in
> `QuorumControllerTest.testUnregisterBroker`:
> {code:java}
> org.opentest4j.AssertionFailedError: expected: <2> but was: <0>
> at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
> at
> org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
> at
> org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:166)
> at
> org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:161)
> at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:628)
> at
> org.apache.kafka.controller.QuorumControllerTest.testUnregisterBroker(QuorumControllerTest.java:494)
> {code}
> I reproduced it by running the test in a loop. It looks like what happens is
> that the BrokerRegistration request is able to get interleaved between the
> leader change event and the write of the bootstrap metadata. Something like
> this:
> # handleLeaderChange() start
> # appendWriteEvent(registerBroker)
> # appendWriteEvent(bootstrapMetadata)
> # handleLeaderChange() finish
> # registerBroker() -> writes broker registration to log
> # bootstrapMetadata() -> writes bootstrap metadata to log
--
This message was sent by Atlassian Jira
(v8.20.10#820010)