[ 
https://issues.apache.org/jira/browse/KAFKA-18771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18105297#comment-18105297
 ] 

Chia-Ping Tsai commented on KAFKA-18771:
----------------------------------------

This test is a bit weird since it tries to verify a recoverable and transient 
error. There is already a unit test covering it 
(testDescribeMetadataQuorumRetriableError).

We can just retry describeMetadataQuorum if the previous request gets an 
unexpected result. This will fix the flaky behavior and ensure we eventually 
see the correct leader


{code:java}
                if (quorumInfo.leaderId() != 
quorumInfo2Future.get().leaderId()) {
                    TestUtils.waitForCondition(() -> {
                        try {
                            QuorumInfo quorumInfo2 = 
admin.describeMetadataQuorum().quorumInfo().get();
                            return quorumInfo.leaderId() != 
quorumInfo2.leaderId();
                        } catch (Exception e) {
                            return false;
                        }
                    }, "Timed out waiting for a new leader to be elected and 
returned by describeMetadataQuorum");
                }
{code}
 

> Flaky test KRaftClusterTest .testDescribeQuorumRequestToControllers
> -------------------------------------------------------------------
>
>                 Key: KAFKA-18771
>                 URL: https://issues.apache.org/jira/browse/KAFKA-18771
>             Project: Kafka
>          Issue Type: Test
>          Components: core, kraft, unit tests
>            Reporter: Matthias J. Sax
>            Assignee: PoAn Yang
>            Priority: Critical
>              Labels: flaky-test
>             Fix For: 4.0.0
>
>
> Seeing this test failing very frequently on PR builds as flaky (so a re-run 
> usually passes). But it very high noise ratio and we should look into it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to