Skip to content

KAFKA-20826: Fix EndToEndLatencyTest#testInvalidRecordHeaderValue#22909

Merged
chia7712 merged 2 commits into
apache:trunkfrom
majialoong:KAFKA-20826
Jul 27, 2026
Merged

KAFKA-20826: Fix EndToEndLatencyTest#testInvalidRecordHeaderValue#22909
chia7712 merged 2 commits into
apache:trunkfrom
majialoong:KAFKA-20826

Conversation

@majialoong

@majialoong majialoong commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

testInvalidRecordHeaderValue incorrectly treats -1 as invalid,
although it represents a null header value.

This change uses -2 for the invalid case and validates options directly,
avoiding unnecessary Kafka client initialization and the resulting
connection timeout.

Reviewers: Chia-Ping Tsai chia7712@gmail.com

@github-actions github-actions Bot added triage PRs from the community tools tests Test fixes (including flaky tests) small Small PRs labels Jul 22, 2026

@chia7712 chia7712 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and this patch reduces the execution time from 64 seconds to 1 second

chia7712@2001-b400-e66d-9653-1aea-fd02-45e0-4778:~/project/kafka$ ./gradlew cleanTest tools:test --tests EndToEndLatencyTest

> Configure project :
Starting build with version 4.4.0-SNAPSHOT (commit id 908d4967) using Gradle 9.4.1, Java 21 and Scala 2.13.18
Build properties: ignoreFailures=false, maxParallelForks=24, maxScalacThreads=8, maxTestRetries=0
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

> Task :tools:test

Gradle Test Run :tools:test > Gradle Test Executor 77 > EndToEndLatencyTest > testInvalidArgs() PASSED

Gradle Test Run :tools:test > Gradle Test Executor 77 > EndToEndLatencyTest > shouldAcceptValidNamedArgs() PASSED

Gradle Test Run :tools:test > Gradle Test Executor 77 > EndToEndLatencyTest > testConvertLegacyArgs() PASSED

Gradle Test Run :tools:test > Gradle Test Executor 77 > EndToEndLatencyTest > shouldFailWhenSentRecordIsNotEqualToReceived() PASSED

Gradle Test Run :tools:test > Gradle Test Executor 77 > EndToEndLatencyTest > shouldFailWhenSentHeaderKeyIsNotEqualToReceived() PASSED

Gradle Test Run :tools:test > Gradle Test Executor 77 > EndToEndLatencyTest > shouldFailWhenConsumerRecordsIsEmpty() PASSED

Gradle Test Run :tools:test > Gradle Test Executor 77 > EndToEndLatencyTest > shouldFailWhenReceivedMoreThanOneRecord() PASSED

Gradle Test Run :tools:test > Gradle Test Executor 77 > EndToEndLatencyTest > shouldFailWhenSentRecordKeyIsNotEqualToReceived() PASSED

Gradle Test Run :tools:test > Gradle Test Executor 77 > EndToEndLatencyTest > shouldPassInValidation() PASSED

Gradle Test Run :tools:test > Gradle Test Executor 77 > EndToEndLatencyTest > shouldAcceptMinusOneForRecordHeaderValueSize() PASSED

Gradle Test Run :tools:test > Gradle Test Executor 77 > EndToEndLatencyTest > shouldFailWhenSentHeaderValueIsNotEqualToReceived() PASSED

[Incubating] Problems report is available at: file:///home/chia7712/project/kafka/build/reports/problems/problems-report.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 10.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/9.4.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 1s

@chia7712
chia7712 merged commit 3978783 into apache:trunk Jul 27, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-approved small Small PRs tests Test fixes (including flaky tests) tools triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants