Skip to content
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
9 changes: 5 additions & 4 deletions .gitlab-ci.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Missing global DEFAULT_TEST_JVMS update for JDK 27

Inconsistent test execution across CI matrix: amd64 test jobs will skip Java 27 on PR validation unless NON_DEFAULT_JVMS is explicitly set, while arm64 runs it by default. This defeats the stated goal of 'preparing to support JDK 27' — if tests don't run on PRs, integration issues won't be caught before master.

Assertion details
  • Input: DEFAULT_TEST_JVMS variable at line 60 controls which JVMs run tests by default via CI rules: 'if: $testJvm =~ $DEFAULT_TEST_JVMS'. When Java 27 is added to .test_matrix (line 103), test jobs inheriting from .test_job without an explicit override will use the global DEFAULT_TEST_JVMS regex.
  • Expected: Java 27 tests should run with consistent default treatment across all test jobs. The global DEFAULT_TEST_JVMS should either include 27 (matching the matrix), or all jobs using .test_matrix should explicitly override it.
  • Actual: Global DEFAULT_TEST_JVMS at line 60 is /^(8|11|17|21|25|tip)$/ (no 27). When a job runs with testJvm=27, the CI rule 'if: $testJvm =~ $DEFAULT_TEST_JVMS' evaluates to false, causing the job to not run (or only run on master/mq branches). Individual overrides exist for .test_job_arm64 (line 748), muzzle-dep-report, and test_debugger, but base .test_job jobs without overrides inherit the stale global regex.

Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · Any feedback? Reach out in #autotest

@sarahchen6 sarahchen6 Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The reason we exclude it in DEFAULT_JVMs is to avoid extra CI running for PRs, though JDK 27 EA is still run for all tests on MQ and master pipelines. It's fine to have the JDK 27 EA image run extra, i.e. on PRs, especially for smaller test jobs such arm64 and debugger below.

Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ workflow:
- "17"
- "21"
- "25"
- "27" # JDK 27 TODO: remove after GA (tip will move to 27)
- "semeru11"
- "oracle8"
- "zulu8"
Expand Down Expand Up @@ -744,7 +745,7 @@ muzzle-dep-report:
needs: []
variables:
<<: *tier_m_variables
DEFAULT_TEST_JVMS: /^(8|11|17|21|25|tip)$/
DEFAULT_TEST_JVMS: /^(8|11|17|21|25|27|tip)$/ # Java 27 TODO: remove 27 after GA (tip will move to 27)
GRADLE_PARAMS: "-PskipFlakyTests"
TESTCONTAINERS_CHECKS_DISABLE: "true"
TESTCONTAINERS_RYUK_DISABLED: "true"
Expand Down Expand Up @@ -980,7 +981,7 @@ test_inst_latest:
CACHE_TYPE: "latestdep"
parallel:
matrix:
- testJvm: ["8", "17", "21", "25", "tip"] # the latest "tip" version is 26
- testJvm: ["8", "17", "21", "25", "27", "tip"] # Java 27 TODO: remove 27 after GA (tip will move to 27)
# 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 All @@ -993,7 +994,7 @@ test_inst_latest_arm64:
CACHE_TYPE: "latestdep"
parallel:
matrix:
- testJvm: ["8", "17", "21", "25", "tip"] # the latest "tip" version is 26
- testJvm: ["8", "17", "21", "25", "27", "tip"] # Java 27 TODO: remove 27 after GA (tip will move to 27)
# 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 @@ -1063,7 +1064,7 @@ test_debugger:
variables:
GRADLE_TARGET: ":debuggerTest"
CACHE_TYPE: "base"
DEFAULT_TEST_JVMS: /^(8|11|17|21|25|tip|semeru8)$/ # the latest "tip" version is 26
DEFAULT_TEST_JVMS: /^(8|11|17|21|25|27|tip|semeru8)$/ # Java 27 TODO: remove 27 after GA (tip will move to 27)
Comment thread
sarahchen6 marked this conversation as resolved.
Comment thread
sarahchen6 marked this conversation as resolved.
parallel:
matrix: *test_matrix
# avoid running coverage for semeru8, semeru11, semeru17 and ibm8 as some tests are disabled and therefore cannot reach the
Expand Down
4 changes: 4 additions & 0 deletions .gitlab/upload_ciapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ if [ -n "$TEST_JVM" ]; then
for var in $(compgen -v JAVA_ | grep -E '^JAVA_[0-9]+_HOME$'); do
ver="${var#JAVA_}"
ver="${ver%_HOME}"
# JDK 27 TODO: remove after GA (tip will move to 27)
if [ "$ver" = "27" ]; then
continue
fi
if [ "$ver" -gt "$MAX_VER" ] 2>/dev/null; then
MAX_VER="$ver"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ import java.nio.file.Paths
class TestJvmSpec(val project: Project) {
companion object {
const val TEST_JVM = "testJvm"

// JDK 27 TODO: remove after GA (tip will move to 27)
internal fun resolveTipJavaVersion(javaVersions: List<Int>): String {
val tipJavaVersions = javaVersions.filterNot { it == 27 }
if (tipJavaVersions.isEmpty()) {
throw GradleException("No Java installations found for tip after excluding Java 27.")
}

return tipJavaVersions.max().toString()
}
}

private val currentJavaHomePath = project.providers.systemProperty("java.home").map { it.normalizeToJDKJavaHome() }
Expand All @@ -63,7 +73,7 @@ class TestJvmSpec(val project: Project) {
throw GradleException("No Java installations found via toolchains or JAVA_X_HOME environment variables.")
}

javaVersions.max().toString()
resolveTipJavaVersion(javaVersions) // JDK 27 TODO: revert back to "javaVersions.max().toString()" after GA
}

else -> testJvm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assumptions.assumeFalse;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyList;
import static org.mockito.Mockito.doAnswer;
Expand All @@ -24,6 +25,7 @@
import com.datadog.debugger.sink.DebuggerSink;
import com.datadog.debugger.sink.ProbeStatusSink;
import com.datadog.debugger.util.TestSnapshotListener;
import datadog.environment.JavaVirtualMachine;
import datadog.trace.api.Config;
import datadog.trace.api.GlobalTracer;
import datadog.trace.api.Tracer;
Expand Down Expand Up @@ -132,8 +134,13 @@ void setup() {
DebuggerContext.initProbeResolver(null);
}

private static void assumeNotJdk27() {
assumeFalse(JavaVirtualMachine.isJavaVersion(27), "JDK 27 TODO: address failing test");
}

@Test
public void testDump() {
assumeNotJdk27();
Config config = createConfig();
Path initialTmpDir = DebuggerTransformer.DUMP_PATH;
DebuggerTransformer.DUMP_PATH = Paths.get("/tmp/debugger");
Expand Down Expand Up @@ -171,6 +178,7 @@ public void testDump() {

@Test
public void testMultiProbes() {
assumeNotJdk27();
doTestMultiProbes(
Class::getName,
new ProbeTestInfo(ArrayList.class, "add"),
Expand All @@ -179,6 +187,7 @@ public void testMultiProbes() {

@Test
public void testMultiProbesSimpleName() {
assumeNotJdk27();
doTestMultiProbes(
Class::getSimpleName,
new ProbeTestInfo(ArrayList.class, "add"),
Expand Down Expand Up @@ -273,6 +282,7 @@ public void testBlockedProbes() {

@Test
public void classBeingRedefinedNull() {
assumeNotJdk27();
Config config = createConfig();
LogProbe logProbe = LogProbe.builder().where("ArrayList", "add").probeId("", 0).build();
Configuration configuration =
Expand Down Expand Up @@ -305,6 +315,7 @@ public void classBeingRedefinedNull() {
value = "datadog.environment.JavaVirtualMachine#isJ9",
disabledReason = "Issue with J9: Flaky")
public void classGenerationFailed() {
assumeNotJdk27();
Config config = createConfig();
final String CLASS_NAME = ArrayList.class.getTypeName();
final String METHOD_NAME = "add";
Expand Down Expand Up @@ -371,6 +382,7 @@ public void classGenerationFailed() {

@Test
public void ordering() {
assumeNotJdk27();
Config config = createConfig();
List<ProbeDefinition> invocationOrder = new ArrayList<>();
MetricProbe metricProbe = createMock(MetricProbe.class, invocationOrder, "metric");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assumptions.assumeFalse;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.atLeastOnce;
Expand All @@ -15,6 +16,7 @@

import com.datadog.debugger.sink.SymbolSink;
import com.datadog.debugger.util.ClassNameFiltering;
import datadog.environment.JavaVirtualMachine;
import java.net.URL;
import java.security.CodeSource;
import java.security.ProtectionDomain;
Expand Down Expand Up @@ -81,6 +83,7 @@ void testScanQueuedCorruptedJars() {
value = "datadog.environment.JavaVirtualMachine#isJ9",
disabledReason = "Flaky on J9 JVMs")
void testScopeFilter() {
assumeFalse(JavaVirtualMachine.isJavaVersion(27), "JDK 27 TODO: address failing test");
ScopeFilter mockFilter = mock(ScopeFilter.class);
when(mockFilter.filterOut(any())).thenReturn(true);
SymbolSink symbolSink = mock(SymbolSink.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import static datadog.trace.agent.test.utils.TraceUtils.basicSpan
import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace
import static org.asynchttpclient.Dsl.asyncHttpClient

import datadog.environment.JavaVirtualMachine
import datadog.trace.agent.test.base.HttpClientTest
import datadog.trace.agent.test.naming.TestingNettyHttpNamingConventions
import datadog.trace.bootstrap.instrumentation.api.Tags
Expand All @@ -22,6 +23,7 @@ import org.asynchttpclient.DefaultAsyncHttpClientConfig
import org.asynchttpclient.Response
import org.asynchttpclient.proxy.ProxyServer
import spock.lang.AutoCleanup
import spock.lang.IgnoreIf
import spock.lang.Timeout

import java.util.concurrent.ExecutionException
Expand Down Expand Up @@ -95,6 +97,9 @@ abstract class Netty41ClientTest extends HttpClientTest {
return false
}

@IgnoreIf(reason = "JDK 27 TODO: address failing test", value = {
JavaVirtualMachine.isJavaVersion(27)
})
def "connection error (unopened port)"() {
given:
def uri = new URI("http://127.0.0.1:$UNUSABLE_PORT/")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package datadog.trace.agent

import datadog.environment.JavaVirtualMachine
import datadog.trace.agent.test.IntegrationTestUtils
import jvmbootstraptest.AgentLoadedChecker
import jvmbootstraptest.JmxStartedChecker
import spock.lang.IgnoreIf
import spock.lang.Specification
import spock.lang.Timeout

Expand Down Expand Up @@ -73,6 +75,9 @@ class JMXFetchTest extends Specification {
returnCode == 0
}

@IgnoreIf(reason = "JDK 27 TODO: address failing test", value = {
JavaVirtualMachine.isJavaVersion(27)
})
def "test jmxfetch config"() {
setup:
def configSettings = names.collect {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ void testNew(
int expectedTraces,
int expectedCoverages)
throws IOException {
Assumptions.assumeFalse(
JavaVirtualMachine.isJavaVersion(27), "JDK 27 TODO: address failing test");
runGradleTest(
gradleVersion,
projectName,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package datadog.smoketest;

import datadog.communication.util.IOUtils;
import datadog.environment.JavaVirtualMachine;
import datadog.trace.civisibility.utils.ShellCommandExecutor;
import java.nio.file.Files;
import java.nio.file.Path;
Expand All @@ -9,6 +10,7 @@
import java.util.List;
import java.util.Map;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.io.TempDir;
import org.junit.jupiter.params.ParameterizedTest;
import org.opentest4j.AssertionFailedError;
Expand Down Expand Up @@ -46,6 +48,8 @@ class GradleLauncherSmokeTest extends AbstractGradleTest {
@ParameterizedTest
void testGradleLauncherInjectsTracerIntoGradleDaemon(
String gradleVersion, String gradleDaemonCmdLineParams) throws Exception {
Assumptions.assumeFalse(
JavaVirtualMachine.isJavaVersion(27), "JDK 27 TODO: address failing test");
String resolvedGradleVersion =
"latest".equals(gradleVersion) ? LATEST_GRADLE_VERSION : gradleVersion;
String cmdLineParams =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assumptions.assumeFalse;
import static org.junit.jupiter.api.Assumptions.assumeTrue;

import datadog.environment.JavaVirtualMachine;
Expand Down Expand Up @@ -73,6 +74,7 @@ public static boolean disabledOnIbm8() {

@BeforeEach
void resetMockBackend() {
assumeFalse(JavaVirtualMachine.isJavaVersion(27), "JDK 27 TODO: address failing test");
mockBackend.reset();
}

Expand Down
Loading