diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4fa391da6c9..9afc147a22e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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" @@ -63,6 +63,7 @@ workflow: - "11" - "17" - "21" + - "stable" - "semeru11" - "oracle8" - "zulu8" @@ -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"] @@ -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 diff --git a/BUILDING.md b/BUILDING.md index b226da6805a..2d7fc35ca39 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -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. @@ -51,8 +52,8 @@ 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. @@ -60,13 +61,13 @@ Requirements to build the full project: ### 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/): ``` @@ -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-/Contents/Home export JAVA_HOME=$JAVA_8_HOME ``` @@ -93,7 +95,7 @@ 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 @@ -101,6 +103,7 @@ Download and install JDK versions 8, 11, 17 and 21, and GraalVM 17 for your OS. export JAVA_11_HOME=//jdk-11. export JAVA_17_HOME=//jdk-17. export JAVA_21_HOME=//jdk-21. + export JAVA_24_HOME=//jdk-24. export JAVA_GRAALVM17_HOME=//graalvm-jdk-17./Contents/Home export JAVA_HOME=$JAVA_8_HOME ``` @@ -108,7 +111,7 @@ Download and install JDK versions 8, 11, 17 and 21, and GraalVM 17 for your OS. #### 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/).
Alternatively, install JDKs using winget or scoop. (click here to expand) @@ -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 @@ -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 ```
@@ -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) diff --git a/dd-java-agent/instrumentation/java-concurrent/src/test/groovy/QueueTimingForkedTest.groovy b/dd-java-agent/instrumentation/java-concurrent/src/test/groovy/QueueTimingForkedTest.groovy index dc7369692e7..7a8597aa1fe 100644 --- a/dd-java-agent/instrumentation/java-concurrent/src/test/groovy/QueueTimingForkedTest.groovy +++ b/dd-java-agent/instrumentation/java-concurrent/src/test/groovy/QueueTimingForkedTest.groovy @@ -31,7 +31,7 @@ class QueueTimingForkedTest extends AgentTestRunner { }) then: - verify(LinkedBlockingQueue.name) + verify(LinkedBlockingQueue.name, 'TestRunnable') when: runUnderTrace("parent", { @@ -39,9 +39,12 @@ class QueueTimingForkedTest extends AgentTestRunner { }) 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: @@ -50,7 +53,7 @@ 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 @@ -58,7 +61,7 @@ class QueueTimingForkedTest extends AgentTestRunner { 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 diff --git a/dd-java-agent/instrumentation/karate/src/test/groovy/KarateTest.groovy b/dd-java-agent/instrumentation/karate/src/test/groovy/KarateTest.groovy index 38ec2734e01..f23d99e7a7e 100644 --- a/dd-java-agent/instrumentation/karate/src/test/groovy/KarateTest.groovy +++ b/dd-java-agent/instrumentation/karate/src/test/groovy/KarateTest.groovy @@ -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 @@ -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 { diff --git a/dd-java-agent/instrumentation/vertx-pg-client-4.0/src/test/groovy/VertxPostgresSqlClientForkedTest.groovy b/dd-java-agent/instrumentation/vertx-pg-client-4.0/src/test/groovy/VertxPostgresSqlClientForkedTest.groovy index beb8baf354d..a7f538c5606 100644 --- a/dd-java-agent/instrumentation/vertx-pg-client-4.0/src/test/groovy/VertxPostgresSqlClientForkedTest.groovy +++ b/dd-java-agent/instrumentation/vertx-pg-client-4.0/src/test/groovy/VertxPostgresSqlClientForkedTest.groovy @@ -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 diff --git a/dd-java-agent/instrumentation/wildfly-9/src/test/groovy/WildFlyForkedTest.groovy b/dd-java-agent/instrumentation/wildfly-9/src/test/groovy/WildFlyForkedTest.groovy index 969d831b5be..6c7d18841bd 100644 --- a/dd-java-agent/instrumentation/wildfly-9/src/test/groovy/WildFlyForkedTest.groovy +++ b/dd-java-agent/instrumentation/wildfly-9/src/test/groovy/WildFlyForkedTest.groovy @@ -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 implements TestingGenericHttpNamingConventions.ServerV0 { @Override EmbeddedWildfly startServer(int port) { diff --git a/dd-java-agent/src/test/groovy/datadog/trace/agent/InitializationTelemetryTest.groovy b/dd-java-agent/src/test/groovy/datadog/trace/agent/InitializationTelemetryTest.groovy index af05b91571b..e990a2226fa 100644 --- a/dd-java-agent/src/test/groovy/datadog/trace/agent/InitializationTelemetryTest.groovy +++ b/dd-java-agent/src/test/groovy/datadog/trace/agent/InitializationTelemetryTest.groovy @@ -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, diff --git a/dd-java-agent/src/test/groovy/datadog/trace/agent/SecurityManagerTest.groovy b/dd-java-agent/src/test/groovy/datadog/trace/agent/SecurityManagerTest.groovy index e7c65e918b8..1e0282b6169 100644 --- a/dd-java-agent/src/test/groovy/datadog/trace/agent/SecurityManagerTest.groovy +++ b/dd-java-agent/src/test/groovy/datadog/trace/agent/SecurityManagerTest.groovy @@ -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: @@ -27,4 +32,4 @@ class SecurityManagerTest extends Specification { expect: SecurityManagerCheck.runTestJvm(TestSecurityManager.NoNetworkAccess) == 0 } -} \ No newline at end of file +} diff --git a/dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/AbstractGradleTest.groovy b/dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/AbstractGradleTest.groovy index c9de4587931..9d4e562d809 100644 --- a/dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/AbstractGradleTest.groovy +++ b/dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/AbstractGradleTest.groovy @@ -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" diff --git a/dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/GradleDaemonSmokeTest.groovy b/dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/GradleDaemonSmokeTest.groovy index 1a36eb4c081..b6616e8347b 100644 --- a/dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/GradleDaemonSmokeTest.groovy +++ b/dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/GradleDaemonSmokeTest.groovy @@ -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) diff --git a/dd-smoke-tests/jboss-modules/src/test/groovy/datadog/smoketest/JBossModulesV2SmokeTest.groovy b/dd-smoke-tests/jboss-modules/src/test/groovy/datadog/smoketest/JBossModulesV2SmokeTest.groovy index 299a0239162..22c08efba93 100644 --- a/dd-smoke-tests/jboss-modules/src/test/groovy/datadog/smoketest/JBossModulesV2SmokeTest.groovy +++ b/dd-smoke-tests/jboss-modules/src/test/groovy/datadog/smoketest/JBossModulesV2SmokeTest.groovy @@ -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 {} diff --git a/dd-smoke-tests/log-injection/build.gradle b/dd-smoke-tests/log-injection/build.gradle index 97c2ccb8f80..c7b8d580dec 100644 --- a/dd-smoke-tests/log-injection/build.gradle +++ b/dd-smoke-tests/log-injection/build.gradle @@ -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 diff --git a/dd-smoke-tests/maven/src/test/groovy/datadog/smoketest/MavenSmokeTest.groovy b/dd-smoke-tests/maven/src/test/groovy/datadog/smoketest/MavenSmokeTest.groovy index ff039e7e51e..74379a36f7a 100644 --- a/dd-smoke-tests/maven/src/test/groovy/datadog/smoketest/MavenSmokeTest.groovy +++ b/dd-smoke-tests/maven/src/test/groovy/datadog/smoketest/MavenSmokeTest.groovy @@ -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 @@ -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) diff --git a/dd-smoke-tests/profiling-integration-tests/src/test/java/datadog/smoketest/JFRBasedProfilingIntegrationTest.java b/dd-smoke-tests/profiling-integration-tests/src/test/java/datadog/smoketest/JFRBasedProfilingIntegrationTest.java index 4c26b072d48..3c16bd110df 100644 --- a/dd-smoke-tests/profiling-integration-tests/src/test/java/datadog/smoketest/JFRBasedProfilingIntegrationTest.java +++ b/dd-smoke-tests/profiling-integration-tests/src/test/java/datadog/smoketest/JFRBasedProfilingIntegrationTest.java @@ -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; @@ -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); @@ -841,4 +845,8 @@ private static boolean logHasErrors(final Path logFilePath) throws IOException { } return logHasErrors[0]; } + + public static boolean isJavaVersionAtLeast24() { + return Platform.isJavaVersionAtLeast(24); + } } diff --git a/dd-smoke-tests/quarkus/src/test/groovy/datadog/smoketest/QuarkusJBossLoggingSmokeTest.groovy b/dd-smoke-tests/quarkus/src/test/groovy/datadog/smoketest/QuarkusJBossLoggingSmokeTest.groovy index 12b347f6fff..61671b31499 100644 --- a/dd-smoke-tests/quarkus/src/test/groovy/datadog/smoketest/QuarkusJBossLoggingSmokeTest.groovy +++ b/dd-smoke-tests/quarkus/src/test/groovy/datadog/smoketest/QuarkusJBossLoggingSmokeTest.groovy @@ -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() { diff --git a/dd-smoke-tests/quarkus/src/test/groovy/datadog/smoketest/QuarkusSlf4jSmokeTest.groovy b/dd-smoke-tests/quarkus/src/test/groovy/datadog/smoketest/QuarkusSlf4jSmokeTest.groovy index 5dd02f2c271..c65028e3959 100644 --- a/dd-smoke-tests/quarkus/src/test/groovy/datadog/smoketest/QuarkusSlf4jSmokeTest.groovy +++ b/dd-smoke-tests/quarkus/src/test/groovy/datadog/smoketest/QuarkusSlf4jSmokeTest.groovy @@ -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 QuarkusSlf4jSmokeTest extends QuarkusSmokeTest { @Override String helloEndpointName() { diff --git a/gradle/java_no_deps.gradle b/gradle/java_no_deps.gradle index e1e9e39f3d8..895ff430627 100644 --- a/gradle/java_no_deps.gradle +++ b/gradle/java_no_deps.gradle @@ -150,6 +150,17 @@ def currentJavaHomePath = getJavaHomePath(System.getProperty("java.home")) project.afterEvaluate { def testJvm = gradle.startParameter.projectProperties["testJvm"] def javaTestLauncher = null as Provider + if (testJvm == "stable") { + def javaVersions = System.getenv() + .findAll { it.key =~ /^JAVA_[0-9]+_HOME$/ } + .collect { (it.key =~ /^JAVA_(\d+)_HOME$/)[0][1] as Integer } + + if (javaVersions.isEmpty()) { + throw new GradleException("No valid JAVA_X_HOME environment variables found.") + } + + testJvm = javaVersions.max().toString() + } if (testJvm) { def matcher = testJvm =~ /([a-zA-Z]*)([0-9]+)/ if (!matcher.matches()) { diff --git a/setup.ps1 b/setup.ps1 index 2e0b0d06ab8..ea2d8a9f462 100644 --- a/setup.ps1 +++ b/setup.ps1 @@ -50,6 +50,7 @@ TestJvm 'JAVA_8_HOME' '1.8' TestJvm 'JAVA_11_HOME' '11' TestJvm 'JAVA_17_HOME' '17' TestJvm 'JAVA_21_HOME' '21' +TestJvm 'JAVA_24_HOME' '24' # GraalVM cannot currently be installed due to license change in October 2024 for GraalVM 17.0.13 and later. # TestJvm 'JAVA_GRAALVM17_HOME' '17' diff --git a/setup.sh b/setup.sh index 311fcd3a678..61e1e4f780a 100755 --- a/setup.sh +++ b/setup.sh @@ -36,6 +36,7 @@ check-jvm "JAVA_8_HOME" "1.8" check-jvm "JAVA_11_HOME" "11" check-jvm "JAVA_17_HOME" "17" check-jvm "JAVA_21_HOME" "21" +check-jvm "JAVA_24_HOME" "24" check-jvm "JAVA_GRAALVM17_HOME" "17"