Skip to content

Add testing for latest stable version (JDK 24) #8875

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 18 commits into from
Jun 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ variables:
GRADLE_PLUGIN_PROXY: "http://artifactual.artifactual.all-clusters.local-dc.fabric.dog:8081/repository/gradle-plugin-portal-proxy/"
BUILDER_IMAGE_VERSION_PREFIX: "v25.06-" # use either an empty string (e.g. "") for latest images or a version followed by a hyphen (e.g. "v25.05-")
REPO_NOTIFICATION_CHANNEL: "#apm-java-escalations"
DEFAULT_TEST_JVMS: /^(8|11|17|21)$/
DEFAULT_TEST_JVMS: /^(8|11|17|21|stable)$/
PROFILE_TESTS:
description: "Enable profiling of tests"
value: "false"
Expand Down Expand Up @@ -63,6 +63,7 @@ workflow:
- "11"
- "17"
- "21"
- "stable"
- "semeru11"
- "oracle8"
- "zulu8"
Expand Down Expand Up @@ -560,7 +561,7 @@ test_inst_latest:
CACHE_TYPE: "latestDep"
parallel:
matrix:
- testJvm: ["8", "17", "21" ]
- testJvm: ["8", "17", "21", "stable"]
# Gitlab doesn't support "parallel" and "parallel:matrix" at the same time
# This emulates "parallel" by including it in the matrix
CI_SPLIT: [ "1/6", "2/6", "3/6", "4/6", "5/6", "6/6"]
Expand Down Expand Up @@ -612,7 +613,7 @@ test_debugger:
variables:
GRADLE_TARGET: ":debuggerTest"
CACHE_TYPE: "base"
DEFAULT_TEST_JVMS: /^(8|11|17|21|semeru8)$/
DEFAULT_TEST_JVMS: /^(8|11|17|21|stable|semeru8)$/
parallel:
matrix: *test_matrix

Expand Down
32 changes: 19 additions & 13 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ or on Windows:
Your output should look something like the following:

```
ℹ️ Checking required JVM:
✅ JAVA_HOME is set to /Users/datadog/.sdkman/candidates/java/8.0.402-zulu.
✅ JAVA_8_HOME is set to /Users/datadog/.sdkman/candidates/java/8.0.402-zulu.
✅ JAVA_11_HOME is set to /Users/datadog/.sdkman/candidates/java/11.0.22-zulu.
✅ JAVA_17_HOME is set to /Users/datadog/.sdkman/candidates/java/17.0.10-zulu.
✅ JAVA_21_HOME is set to /Users/datadog/.sdkman/candidates/java/21.0.2-zulu.
✅ JAVA_GRAALVM17_HOME is set to /Users/datadog/.sdkman/candidates/java/17.0.9-graalce.
ℹ️ Checking required JVMs:
✅ JAVA_HOME is set to /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home.
✅ JAVA_8_HOME is set to /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home.
✅ JAVA_11_HOME is set to /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home.
✅ JAVA_17_HOME is set to /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home.
✅ JAVA_21_HOME is set to /Library/Java/JavaVirtualMachines/zulu-21.jdk/Contents/Home.
✅ JAVA_24_HOME is set to /Library/Java/JavaVirtualMachines/zulu-24.jdk/Contents/Home.
✅ JAVA_GRAALVM17_HOME is set to /Library/Java/JavaVirtualMachines/graalvm-ce-java17-22.3.1/Contents/Home.
ℹ️ Checking git configuration:
✅ The git command line is installed.
✅ pre-commit hook is installed in repository.
Expand All @@ -51,22 +52,22 @@ If there is any issue with your output, check the requirements above and use the

Requirements to build the full project:

* The JDK versions 8, 11, 17 and 21 must be installed.
* The `JAVA_8_HOME`, `JAVA_11_HOME`, `JAVA_17_HOME`, `JAVA_21_HOME`, and `JAVA_GRAALVM17_HOME` must point to their respective JDK location.
* The JDK versions 8, 11, 17, 21, and 24 must be installed.
* The `JAVA_8_HOME`, `JAVA_11_HOME`, `JAVA_17_HOME`, `JAVA_21_HOME`, `JAVA_24_HOME`, and `JAVA_GRAALVM17_HOME` must point to their respective JDK location.
* The JDK 8 `bin` directory must be the only JDK on the PATH (e.g. `$JAVA_8_HOME/bin`).
* The `JAVA_HOME` environment variable may be unset. If set, it must point to the JDK 8 location (same as `JAVA_8_HOME`).
* The `git` command line must be installed.
* A container runtime environment must be available to run all tests (e.g. Docker Desktop).

### Install the required JDKs

Download and install JDK versions 8, 11, 17 and 21, and GraalVM 17 for your OS.
Download and install JDK versions 8, 11, 17, 21 and 24, and GraalVM 17 for your OS.

#### macOS

* Install the required JDKs using `brew`:
```shell
brew install --cask zulu@8 zulu@11 zulu@17 zulu@21 graalvm/tap/graalvm-ce-java17
brew install --cask zulu@8 zulu@11 zulu@17 zulu@21 zulu graalvm/tap/graalvm-ce-java17
```
* Fix the GraalVM installation by [removing the quarantine flag](https://www.graalvm.org/latest/docs/getting-started/macos/):
```
Expand All @@ -78,6 +79,7 @@ Download and install JDK versions 8, 11, 17 and 21, and GraalVM 17 for your OS.
export JAVA_11_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
export JAVA_17_HOME=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
export JAVA_21_HOME=/Library/Java/JavaVirtualMachines/zulu-21.jdk/Contents/Home
export JAVA_24_HOME=/Library/Java/JavaVirtualMachines/zulu-24.jdk/Contents/Home
export JAVA_GRAALVM17_HOME=/Library/Java/JavaVirtualMachines/graalvm-<current version of graalvm>/Contents/Home
export JAVA_HOME=$JAVA_8_HOME
```
Expand All @@ -93,22 +95,23 @@ Download and install JDK versions 8, 11, 17 and 21, and GraalVM 17 for your OS.

#### Linux

* Download and extract JDK 8, 11, 17, and 21 from [Eclipse Temurin releases](https://adoptium.net/temurin/releases/) and GraalVM 17 from [Oracle downloads](https://www.graalvm.org/downloads/).
* Download and extract JDK 8, 11, 17, 21, and 24 from [Eclipse Temurin releases](https://adoptium.net/temurin/releases/) and GraalVM 17 from [Oracle downloads](https://www.graalvm.org/downloads/).
* Install the GraalVM native image requirements for native builds by following [the GraalVM official documentation](https://www.graalvm.org/latest/reference-manual/native-image/#prerequisites).
* Add the required environment variables to your shell using the `export` command. You can permanently install the environment variables by appending the `export` commands into your shell configuration file `~/.zshrc` or `~/.bashrc` or other.
```shell
export JAVA_8_HOME=/<path to extracted archive>/jdk8u<current version of JDK 8>
export JAVA_11_HOME=/<path to extracted archive>/jdk-11.<current version of JDK 11>
export JAVA_17_HOME=/<path to extracted archive>/jdk-17.<current version of JDK 17>
export JAVA_21_HOME=/<path to extracted archive>/jdk-21.<current version of JDK 21>
export JAVA_24_HOME=/<path to extracted archive>/jdk-24.<current version of JDK 24>
export JAVA_GRAALVM17_HOME=/<path to extracted archive>/graalvm-jdk-17.<current version of graalvm>/Contents/Home
export JAVA_HOME=$JAVA_8_HOME
```
* Restart your shell after applying the changes if you appended the commands to your shell configuration file.

#### Windows

* Download and install JDK 8, 11, 17, and 21 [Eclipse Temurin releases](https://adoptium.net/temurin/releases/).
* Download and install JDK 8, 11, 17, 21, and 24 [Eclipse Temurin releases](https://adoptium.net/temurin/releases/).

<details>
<summary>Alternatively, install JDKs using winget or scoop. (click here to expand)</summary>
Expand All @@ -118,6 +121,7 @@ Download and install JDK versions 8, 11, 17 and 21, and GraalVM 17 for your OS.
winget install --id EclipseAdoptium.Temurin.11.JDK
winget install --id EclipseAdoptium.Temurin.17.JDK
winget install --id EclipseAdoptium.Temurin.21.JDK
winget install --id EclipseAdoptium.Temurin.24.JDK
```

```pwsh
Expand All @@ -126,6 +130,7 @@ Download and install JDK versions 8, 11, 17 and 21, and GraalVM 17 for your OS.
scoop install temurin11-jdk
scoop install temurin17-jdk
scoop install temurin21-jdk
scoop install temurin24-jdk
```

</details>
Expand All @@ -136,6 +141,7 @@ Download and install JDK versions 8, 11, 17 and 21, and GraalVM 17 for your OS.
[Environment]::SetEnvironmentVariable("JAVA_11_HOME", "C:\Program Files\Eclipse Adoptium\jdk-11.0.25.9-hotspot", [EnvironmentVariableTarget]::User)
[Environment]::SetEnvironmentVariable("JAVA_17_HOME", "C:\Program Files\Eclipse Adoptium\jdk-17.0.12.7-hotspot", [EnvironmentVariableTarget]::User)
[Environment]::SetEnvironmentVariable("JAVA_21_HOME", "C:\Program Files\Eclipse Adoptium\jdk-21.0.5.11-hotspot", [EnvironmentVariableTarget]::User)
[Environment]::SetEnvironmentVariable("JAVA_24_HOME", "C:\Program Files\Eclipse Adoptium\jdk-24.0.1.9-hotspot", [EnvironmentVariableTarget]::User)

# JAVA_HOME = JAVA_8_HOME
[Environment]::SetEnvironmentVariable("JAVA_HOME", "C:\Program Files\Eclipse Adoptium\jdk-8.0.432.6-hotspot", [EnvironmentVariableTarget]::User)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,20 @@ class QueueTimingForkedTest extends AgentTestRunner {
})

then:
verify(LinkedBlockingQueue.name)
verify(LinkedBlockingQueue.name, 'TestRunnable')

when:
runUnderTrace("parent", {
fjp.submit(new TestRunnable()).get()
})

then:
// Starting from Java 24, ForkJoinPool will wrap a Runnable with the {@code java.util.concurrent.ForkJoinTask$AdaptedInterruptibleRunnable} class
String expectedTaskClassName = Platform.isJavaVersionAtLeast(24) ? 'AdaptedInterruptibleRunnable' : 'TestRunnable'

// flaky before JDK21
if (Platform.isJavaVersionAtLeast(21)) {
verify("java.util.concurrent.ForkJoinPool\$WorkQueue")
verify("java.util.concurrent.ForkJoinPool\$WorkQueue", expectedTaskClassName)
}

cleanup:
Expand All @@ -50,15 +53,15 @@ class QueueTimingForkedTest extends AgentTestRunner {
TEST_PROFILING_CONTEXT_INTEGRATION.closedTimings.clear()
}

void verify(expectedQueueType) {
void verify(expectedQueueType, expectedTaskClassName) {
assert TEST_PROFILING_CONTEXT_INTEGRATION.isBalanced()
assert !TEST_PROFILING_CONTEXT_INTEGRATION.closedTimings.isEmpty()
int numAsserts = 0
while (!TEST_PROFILING_CONTEXT_INTEGRATION.closedTimings.isEmpty()) {
def timing = TEST_PROFILING_CONTEXT_INTEGRATION.closedTimings.takeFirst() as TestProfilingContextIntegration.TestQueueTiming
if (!(timing.task as Class).simpleName.isEmpty()) {
assert timing != null
assert timing.task == TestRunnable
assert timing.task.simpleName == expectedTaskClassName
assert timing.scheduler != null
assert timing.origin == Thread.currentThread()
assert timing.queueLength >= 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datadog.trace.api.DisableTestTrace
import datadog.trace.api.civisibility.config.TestFQN
import datadog.trace.api.civisibility.config.TestIdentifier
import datadog.trace.api.Platform
import datadog.trace.civisibility.CiVisibilityInstrumentationTest
import datadog.trace.instrumentation.karate.KarateUtils
import datadog.trace.instrumentation.karate.TestEventsHandlerHolder
Expand All @@ -13,12 +14,16 @@ import org.junit.platform.launcher.TestExecutionListener
import org.junit.platform.launcher.core.LauncherConfig
import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder
import org.junit.platform.launcher.core.LauncherFactory
import spock.lang.IgnoreIf

import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.CopyOnWriteArrayList

import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass

@IgnoreIf(reason = "Karate instrumentation is creating an unclosed span of kind test_suite_end specifically for Java 24. Skip until we have a fix.", value = {
Platform.isJavaVersionAtLeast(24)
})
@DisableTestTrace(reason = "avoid self-tracing")
class KarateTest extends CiVisibilityInstrumentationTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ import io.vertx.pgclient.PgPool
import io.vertx.sqlclient.*
import spock.lang.AutoCleanup
import spock.lang.Shared
import spock.lang.IgnoreIf

import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit

import static datadog.trace.agent.test.utils.TraceUtils.basicSpan
import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace
import datadog.trace.api.Platform

@IgnoreIf(reason = "A change in Locale.ROOT that was introduced in JDK 22 is not fixed until vertx-pg-client v4.5.1: https://github.com/eclipse-vertx/vertx-sql-client/pull/1394", value = {
Platform.isJavaVersionAtLeast(22)
})
class VertxPostgresSqlClientForkedTest extends AgentTestRunner {
@AutoCleanup
@Shared
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ import datadog.trace.agent.test.utils.OkHttpUtils
import datadog.trace.api.DDSpanTypes
import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags
import datadog.trace.bootstrap.instrumentation.api.Tags
import datadog.trace.api.Platform
import okhttp3.HttpUrl
import okhttp3.Request
import org.jboss.shrinkwrap.api.ShrinkWrap
import org.jboss.shrinkwrap.api.spec.WebArchive
import spock.lang.IgnoreIf
import test.JakartaTestServlet
import test.TestServlet

@IgnoreIf(reason = "WildFly does not guarantee support for Java SE 24. The latest version 36 of WildFly recommends using the latest Java LTS: https://docs.wildfly.org/36/Getting_Started_Guide.html#requirements", value = {
Platform.isJavaVersionAtLeast(22)
})
class WildFlyForkedTest extends WithHttpServer<EmbeddedWildfly> implements TestingGenericHttpNamingConventions.ServerV0 {
@Override
EmbeddedWildfly startServer(int port) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@ package datadog.trace.agent

import spock.lang.Specification
import spock.lang.Timeout
import spock.lang.IgnoreIf
import datadog.trace.api.Platform

import jvmbootstraptest.InitializationTelemetryCheck

@Timeout(30)
@IgnoreIf(reason = "SecurityManager is permanently disabled as of JDK 24", value = {
Platform.isJavaVersionAtLeast(24)
})
class InitializationTelemetryTest extends Specification {
def "block agent start-up"() {
// In this case, the SecurityManager blocks loading of the Premain Class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ package datadog.trace.agent

import spock.lang.Specification
import spock.lang.Timeout
import spock.lang.IgnoreIf
import datadog.trace.api.Platform

import jvmbootstraptest.SecurityManagerCheck
import jvmbootstraptest.TestSecurityManager

@Timeout(30)
@IgnoreIf(reason = "SecurityManager is permanently disabled as of JDK 24", value = {
Platform.isJavaVersionAtLeast(24)
})
class SecurityManagerTest extends Specification {
def "no env access"() {
expect:
Expand All @@ -27,4 +32,4 @@ class SecurityManagerTest extends Specification {
expect:
SecurityManagerCheck.runTestJvm(TestSecurityManager.NoNetworkAccess) == 0
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ class AbstractGradleTest extends CiVisibilitySmokeTest {

private static boolean isSupported(String gradleVersion) {
// https://docs.gradle.org/current/userguide/compatibility.html
if (Jvm.current.java21Compatible) {
if (Jvm.current.isJavaVersionCompatible(24)) {
return gradleVersion >= "8.14"
} else if (Jvm.current.java21Compatible) {
return gradleVersion >= "8.4"
} else if (Jvm.current.java20) {
return gradleVersion >= "8.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class GradleDaemonSmokeTest extends AbstractGradleTest {
"7.6.4" | "test-corrupted-config-legacy-instrumentation" | false | 1 | 0
}

@IgnoreIf(reason = "Failing on Java 24. Skip until we have a fix.", value = {
Platform.isJavaVersionAtLeast(24)
})
def "test #projectName, v#gradleVersion, configCache: #configurationCache"() {
runGradleTest(gradleVersion, projectName, configurationCache, successExpected, flakyRetries, expectedTraces, expectedCoverages)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
package datadog.smoketest

import spock.lang.IgnoreIf
import datadog.trace.api.Platform

@IgnoreIf(reason = "Failing on Java 24. Skip until we have a fix.", value = {
Platform.isJavaVersionAtLeast(24)
})
class JBossModulesV2SmokeTest extends AbstractModulesSmokeTest {}
9 changes: 9 additions & 0 deletions dd-smoke-tests/log-injection/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ plugins {
apply from: "$rootDir/gradle/java.gradle"
description = 'Log injection Smoke Tests.'

// 3.0.24 added support for JDK 24 via ASM 9.7.1
// https://groovy-lang.org/changelogs/changelog-3.0.24.html
// https://asm.ow2.io/versions.html#9.7.1
configurations.all {
resolutionStrategy {
force 'org.codehaus.groovy:groovy-all:3.0.24'
}
}

configurations {
jcl
log4j1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import datadog.trace.api.Config
import datadog.trace.api.civisibility.CIConstants
import datadog.trace.api.config.CiVisibilityConfig
import datadog.trace.api.config.GeneralConfig
import datadog.trace.api.Platform
import datadog.trace.civisibility.CiVisibilitySmokeTest
import datadog.trace.util.Strings
import java.nio.file.FileVisitResult
Expand All @@ -26,10 +27,14 @@ import org.slf4j.LoggerFactory
import org.w3c.dom.Document
import org.w3c.dom.NodeList
import spock.lang.AutoCleanup
import spock.lang.IgnoreIf
import spock.lang.Shared
import spock.lang.TempDir
import spock.util.environment.Jvm

@IgnoreIf(reason = "Failing on Java 24. Skip until we have a fix.", value = {
Platform.isJavaVersionAtLeast(24)
})
class MavenSmokeTest extends CiVisibilitySmokeTest {

private static final Logger LOGGER = LoggerFactory.getLogger(MavenSmokeTest.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.condition.DisabledIf;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
import org.openjdk.jmc.common.IMCStackTrace;
import org.openjdk.jmc.common.item.Aggregators;
Expand All @@ -70,6 +71,9 @@
import spock.util.environment.OperatingSystem;

@DisabledIfSystemProperty(named = "java.vm.name", matches = ".*J9.*")
@DisabledIf(
value = "isJavaVersionAtLeast24",
disabledReason = "Failing on Java 24. Skip until we have a fix.")
class JFRBasedProfilingIntegrationTest {
private static final Logger log = LoggerFactory.getLogger(JFRBasedProfilingIntegrationTest.class);
private static final Duration ONE_NANO = Duration.ofNanos(1);
Expand Down Expand Up @@ -841,4 +845,8 @@ private static boolean logHasErrors(final Path logFilePath) throws IOException {
}
return logHasErrors[0];
}

public static boolean isJavaVersionAtLeast24() {
return Platform.isJavaVersionAtLeast(24);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package datadog.smoketest

import datadog.trace.api.Platform
import spock.lang.IgnoreIf

@IgnoreIf(reason = "Failing on Java 24. Skip until we have a fix.", value = {
Platform.isJavaVersionAtLeast(24)
})
class QuarkusJBossLoggingSmokeTest extends QuarkusSmokeTest {
@Override
String helloEndpointName() {
Expand Down
Loading
Loading