Skip to content

KAFKA-19382:Upgrade junit from 5.10 to 5.13 #19919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 10, 2025
Merged

Conversation

Rancho-7
Copy link
Collaborator

@Rancho-7 Rancho-7 commented Jun 7, 2025

jira: https://issues.apache.org/jira/browse/KAFKA-19382

Upgrade junit from 5.10.2 to
5.13.1.

A new behavior was introduced to junit 5.12
(junit-team/junit-framework@89a46df),
disallowing ClusterTestExtensions to generate empty invocation
contexts. However, ClusterTestExtensions is invoked by junit extension
so it could result in empty contexts for some tests.

> Configure project :
Starting build with version 4.1.0-SNAPSHOT (commit id c4a769bc) using
Gradle 8.14.1, Java 17 and Scala 2.13.16
Build properties: ignoreFailures=false, maxParallelForks=10,
maxScalacThreads=8, maxTestRetries=0

> Task :core:test kafka.api.ConsumerBounceTest.initializationError
failed, log available in
/Users/lansg/Project/OpenSource/kafka/kafka-fork/kafka/core/build/reports/testOutput/kafka.api.ConsumerBounceTest.initializationError.test.stdout

Gradle Test Run :core:test > Gradle Test Executor 5 > ConsumerBounceTest
> testCloseDuringRebalance(String) > initializationError FAILED
org.junit.platform.commons.PreconditionViolationException: Provider
[ClusterTestExtensions] did not provide any invocation contexts, but was
expected to do so. You may override
mayReturnZeroTestTemplateInvocationContexts() to allow this.         at
java.base@17.0.13/java.util.ArrayList.forEach(ArrayList.java:1511) at
java.base@17.0.13/java.util.ArrayList.forEach(ArrayList.java:1511)
kafka.api.ConsumerBounceTest.initializationError failed, log available
in
/Users/lansg/Project/OpenSource/kafka/kafka-fork/kafka/core/build/reports/testOutput/kafka.api.ConsumerBounceTest.initializationError.test.stdout

Reviewers: Chia-Ping Tsai chia7712@gmail.com, TengYao Chi
frankvicky@apache.org, Ken Huang s7133700@gmail.com

@github-actions github-actions bot added triage PRs from the community build Gradle build or GitHub Actions small Small PRs labels Jun 7, 2025
@@ -118,6 +118,11 @@ public boolean supportsTestTemplate(ExtensionContext context) {
return true;
}

@Override
public boolean mayReturnZeroTestTemplateInvocationContexts(ExtensionContext context) {
return true;
Copy link
Member

Choose a reason for hiding this comment

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

Please add comment for this magic flag :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! Updated it.

@github-actions github-actions bot removed the triage PRs from the community label Jun 8, 2025
@@ -126,7 +126,7 @@ versions += [
// When updating the zstd version, please do as well in docker/native/native-image-configs/resource-config.json
// Also make sure the compression levels in org.apache.kafka.common.record.CompressionType are still valid
zstd: "1.5.6-10",
junitPlatform: "1.10.2",
junitPlatform: "1.13.1",
Copy link
Member

Choose a reason for hiding this comment

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

excuse me, is 1.13.1 released? the newest version in maven site is 1.31.0

https://mvnrepository.com/artifact/org.junit.platform/junit-platform-launcher

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I noticed those dependencies were not in the maven repository earlier, but they've just been updated now.

image

Copy link
Contributor

@frankvicky frankvicky left a comment

Choose a reason for hiding this comment

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

@Rancho-7: LGTM

Copy link
Contributor

@frankvicky frankvicky left a comment

Choose a reason for hiding this comment

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

Could you also update the version of JUnit in NOTICE-binary ?

@Rancho-7
Copy link
Collaborator Author

Rancho-7 commented Jun 9, 2025

Could you also update the version of JUnit in NOTICE-binary ?

@frankvicky Thanks for catching this.Updated.

@frankvicky
Copy link
Contributor

@Rancho-7
There are some issue that needs to be clarified before modifying NOTICE-binary.
Could you please revert the change of NOTICE-binary and open a jira ticket for it?

@Rancho-7
Copy link
Collaborator Author

@Rancho-7 There are some issue that needs to be clarified before modifying NOTICE-binary. Could you please revert the change of NOTICE-binary and open a jira ticket for it?

Reverted and opened https://issues.apache.org/jira/browse/KAFKA-19395 to track this.

Copy link
Collaborator

@m1a2st m1a2st left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM

@frankvicky frankvicky merged commit 465b01c into apache:trunk Jun 10, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Gradle build or GitHub Actions ci-approved small Small PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants