You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Jiayao Sun (Jira)" <ji...@apache.org> on 2026/05/03 10:12:00 UTC
[jira] [Commented] (KAFKA-16642) Update KafkaConsumerTest to show parameters in test lists
[ https://issues.apache.org/jira/browse/KAFKA-16642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18077886#comment-18077886 ]
Jiayao Sun commented on KAFKA-16642:
------------------------------------
I've looked into this issue and found that it is fundamentally a legacy compatibility problem caused by the discrepancy between *{{LegacyReportingName}}* and *{{DisplayName}}* in JUnit 5.
Currently, tools like Develocity display parameterized tests as
{quote}{{testReturnRecordsDuringRebalance(GroupProtocol)[1]}}
{quote}
This happens because:
# When using {{{}*@ParameterizedTest*{}}}, the JUnit 5 Jupiter engine automatically generates a *{{LegacyReportingName}}* that strictly appends
*"[" + index + "]"* to the method name.
# This was a deliberate design choice by the JUnit 5 team to ensure backward compatibility with older test parsers and IDEs that require unique, simple method-like names for repeated test executions.
# This *{{LegacyReportingName}}* is deeply hardcoded in the JUnit engine and *cannot be modified* via *{{@ParameterizedTest}}* annotations or any configurations.
# While the local {{TEST-*.xml}} reports correctly pick up the customized {{{}DisplayName{}}}, Develocity reads the raw test events from Gradle's binary *{{results-generic.bin}}* file and prioritizes the {{LegacyReportingName}} for its UI.
Given that this behavior is enforced by JUnit 5 and consumed by Develocity, I believe this is not something we can fix within the Kafka codebase.
Perhaps we should report this upstream to the Develocity/Gradle team? They might consider the current behavior a feature (to guarantee test name uniqueness across parameterized runs), but they are ultimately the ones who can adjust the display logic to favor {{{}DisplayName{}}}.😂
> Update KafkaConsumerTest to show parameters in test lists
> ---------------------------------------------------------
>
> Key: KAFKA-16642
> URL: https://issues.apache.org/jira/browse/KAFKA-16642
> Project: Kafka
> Issue Type: Bug
> Components: clients, consumer, unit tests
> Affects Versions: 3.7.0
> Reporter: Kirk True
> Assignee: Chia-Ping Tsai
> Priority: Minor
> Labels: consumer-threading-refactor
>
> {{KafkaConsumerTest}} was recently updated to make many of its tests parameterized to exercise both the {{CLASSIC}} and {{CONSUMER}} group protocols. However, in some of the tools in which [lists of tests are provided|https://ge.apache.org/scans/tests?search.names=Git%20branch&search.relativeStartTime=P28D&search.rootProjectNames=kafka&search.timeZoneId=America%2FLos_Angeles&search.values=trunk&tests.container=org.apache.kafka.clients.consumer.KafkaConsumerTest&tests.sortField=FLAKY], say, for analysis, the group protocol information is not exposed. For example, one test ({{{}testReturnRecordsDuringRebalance{}}}) is flaky, but it's difficult to know at a glance which group protocol is causing the problem because the list simply shows:
> {quote}{{testReturnRecordsDuringRebalance(GroupProtocol)[1]}}
> {quote}
> Ideally, it would expose more information, such as:
> {quote}{{testReturnRecordsDuringRebalance(GroupProtocol=CONSUMER)}}
> {quote}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)