[
https://issues.apache.org/jira/browse/KAFKA-17410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17876397#comment-17876397
]
TengYao Chi commented on KAFKA-17410:
-------------------------------------
Hello [~lianetm] ,
I have reviewed the `testPollThrowsInterruptExceptionIfInterrupted` test case
in both `KafkaConsumerTest` and `AsyncKafkaConsumerTest` classes.
I found that these two classes throw exceptions at different points.
In `AsyncKafkaConsumerTest`, the `InterruptException` is thrown in the
`pollForFetches` method. In `KafkaConsumerTest`, it is thrown in the
`updateAssignmentMetadataIfNeeded` method.
Normally, I would expect them to throw exceptions at the same point. However,
in `AsyncKafkaConsumerTest`, the internal methods of
`updateAssignmentMetadataIfNeeded` that might throw exceptions have been mocked.
This discrepancy might be the cause of the flakiness in
`KafkaConsumerTest#testPollThrowsInterruptExceptionIfInterrupted`.
I am still investigating this issue, please let me know if you have any ideas.
Many thanks :)
> Flaky test testPollThrowsInterruptExceptionIfInterrupted for new consumer
> -------------------------------------------------------------------------
>
> Key: KAFKA-17410
> URL: https://issues.apache.org/jira/browse/KAFKA-17410
> Project: Kafka
> Issue Type: Bug
> Components: clients, consumer
> Reporter: Lianet Magrans
> Assignee: TengYao Chi
> Priority: Major
> Labels: consumer-threading-refactor, flaky-test
>
> KafkaConsumerTest.testPollThrowsInterruptExceptionIfInterrupted is flaky for
> the new consumer (passing consistently for the classic consumer).
> Fails with:
> org.opentest4j.AssertionFailedError: Expected
> org.apache.kafka.common.errors.InterruptException to be thrown, but nothing
> was thrown.
> It's been flaky since enabled for the new consumer recently
> [https://ge.apache.org/scans/tests?search.names=Git%20branch&search.rootProjectNames=kafka&search.startTimeMax=1724385599999&search.startTimeMin=1720065600000&search.timeZoneId=America%2FToronto&search.values=trunk&tests.container=org.apache.kafka.clients.consumer.KafkaConsumerTest&tests.test=testPollThrowsInterruptExceptionIfInterrupted(GroupProtocol)%5B2%5D|https://ge.apache.org/scans/tests?search.names=Git%20branch&search.rootProjectNames=kafka&search.startTimeMax=1724385599999&search.startTimeMin=1720065600000&search.timeZoneId=America%2FToronto&search.values=trunk&tests.container=org.apache.kafka.clients.consumer.KafkaConsumerTest&tests.test=testPollThrowsInterruptExceptionIfInterrupted(GroupProtocol)%5B2%5D.]
> Note that a very similar test already exist in AsyncKafkaConsumerTest.
> testPollThrowsInterruptExceptionIfInterrupted, written specifically for the
> async consumer, and that passes consistently.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)