KAFKA-20826: Fix EndToEndLatencyTest#testInvalidRecordHeaderValue#22909
Merged
Conversation
chia7712
approved these changes
Jul 27, 2026
chia7712
left a comment
Member
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
testInvalidRecordHeaderValueincorrectly 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