This is an automated email from the ASF dual-hosted git repository.
chia7712 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new 25da7051785 MINOR: Run CI with Java 24 (#20295)
25da7051785 is described below
commit 25da7051785b35e7097ee41b430f212e7eafb2f4
Author: Stig Døssing <[email protected]>
AuthorDate: Tue Aug 5 15:26:13 2025 +0200
MINOR: Run CI with Java 24 (#20295)
This commit updates CI to test against Java 24 instead of Java 23 which
is EOL.
Due to Spotbugs not having released version 4.9.4 yet, we can't run
Spotbugs on Java 24. Instead, we are choosing to run Spotbugs, and the
rest of the compile and validate build step, on Java 17 for now.
Once 4.9.4 has released, we will switch to using Java 24 for this.
Exclude spotbugs from the run-tests gradle action. Spotbugs is already
being run once in the build by "compile and validate", there is no
reason to run it again as part of executing tests.
Reviewers: Chia-Ping Tsai <[email protected]>
---
.github/actions/run-gradle/action.yml | 5 +++++
.github/workflows/build.yml | 10 +++++-----
.github/workflows/ci-complete.yml | 2 +-
README.md | 2 +-
build.gradle | 6 ++++++
5 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/.github/actions/run-gradle/action.yml
b/.github/actions/run-gradle/action.yml
index 8422defb273..9c8e0945184 100644
--- a/.github/actions/run-gradle/action.yml
+++ b/.github/actions/run-gradle/action.yml
@@ -83,6 +83,9 @@ runs:
RUN_FLAKY_TESTS: ${{ inputs.run-flaky-tests }}
TEST_XML_OUTPUT_DIR: ${{ inputs.test-xml-output }}
TEST_VERBOSE: ${{ inputs.test-verbose }}
+ # This build step is invoked by build.yml to run junit tests only,
+ # Spotbugs is being run by that workflow via the "check" task and does
not need to also be run here,
+ # since that is redundant.
run: |
set +e
./.github/scripts/thread-dump.sh &
@@ -97,6 +100,8 @@ runs:
-Pkafka.cluster.test.repeat=$TEST_REPEAT \
-Pkafka.test.verbose=$TEST_VERBOSE \
-PcommitId=xxxxxxxxxxxxxxxx \
+ -x spotbugsMain \
+ -x spotbugsTest \
$TEST_TASK
exitcode="$?"
echo "exitcode=$exitcode" >> $GITHUB_OUTPUT
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index fc5ee1bd755..cb2a701fe58 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -127,7 +127,7 @@ jobs:
- name: Setup Gradle
uses: ./.github/actions/setup-gradle
with:
- java-version: 23
+ java-version: 17
gradle-cache-read-only: ${{ !inputs.is-trunk }}
gradle-cache-write-only: ${{ inputs.is-trunk }}
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
@@ -181,7 +181,7 @@ jobs:
fail-fast: false
matrix:
# If we change these, make sure to adjust ci-complete.yml
- java: [ 23, 17 ]
+ java: [ 24, 17 ]
run-flaky: [ true, false ]
run-new: [ true, false ]
exclude:
@@ -270,7 +270,7 @@ jobs:
python .github/scripts/junit.py \
--path build/junit-xml >> $GITHUB_STEP_SUMMARY
- # This job downloads all the JUnit XML files and thread dumps from the JDK
23 test runs.
+ # This job downloads all the JUnit XML files and thread dumps from the JDK
24 test runs.
# If any test job fails, we will not run this job. Also, if any thread dump
artifacts
# are present, this means there was a timeout in the tests and so we will
not proceed
# with catalog creation.
@@ -288,7 +288,7 @@ jobs:
- name: Download Thread Dumps
uses: actions/download-artifact@v4
with:
- pattern: junit-thread-dumps-23-*
+ pattern: junit-thread-dumps-24-*
path: thread-dumps
merge-multiple: true
- name: Check For Thread Dump
@@ -302,7 +302,7 @@ jobs:
- name: Download JUnit XMLs
uses: actions/download-artifact@v4
with:
- pattern: junit-xml-23-* # Only look at JDK 23 tests for the test
catalog
+ pattern: junit-xml-24-* # Only look at JDK 24 tests for the test
catalog
path: junit-xml
merge-multiple: true
- name: Collate Test Catalog
diff --git a/.github/workflows/ci-complete.yml
b/.github/workflows/ci-complete.yml
index 8855c998df2..44d4f5a9c1d 100644
--- a/.github/workflows/ci-complete.yml
+++ b/.github/workflows/ci-complete.yml
@@ -44,7 +44,7 @@ jobs:
fail-fast: false
matrix:
# Make sure these match build.yml
- java: [ 23, 17 ]
+ java: [ 24, 17 ]
run-flaky: [ true, false ]
run-new: [ true, false ]
exclude:
diff --git a/README.md b/README.md
index 4c2fc4e1f16..8b5fe4c332e 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@
You need to have
[Java](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
installed.
-We build and test Apache Kafka with 17 and 23. The `release` parameter in
javac is set to `11` for the clients
+We build and test Apache Kafka with 17 and 24. The `release` parameter in
javac is set to `11` for the clients
and streams modules, and `17` for the rest, ensuring compatibility with their
respective
minimum Java versions. Similarly, the `release` parameter in scalac is set to
`11` for the streams modules and `17`
for the rest.
diff --git a/build.gradle b/build.gradle
index 2b4f1294e9c..6dbe95e5611 100644
--- a/build.gradle
+++ b/build.gradle
@@ -72,6 +72,12 @@ ext {
"--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED"
)
+ if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_24)) {
+ // Spotbugs is not compatible with Java 24+ until Spotbugs 4.9.4. Disable
it until we can upgrade to that version.
+ project.gradle.startParameter.excludedTaskNames.add("spotbugsMain")
+ project.gradle.startParameter.excludedTaskNames.add("spotbugsTest")
+ }
+
maxTestForks = project.hasProperty('maxParallelForks') ?
maxParallelForks.toInteger() : Runtime.runtime.availableProcessors()
maxScalacThreads = project.hasProperty('maxScalacThreads') ?
maxScalacThreads.toInteger() :
Math.min(Runtime.runtime.availableProcessors(), 8)