Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
68768ad
Initial support for running tests on CI under Windows OS.
AlexeyKuznetsov-DD Mar 27, 2026
855700a
Code review.
AlexeyKuznetsov-DD Mar 27, 2026
3c3d311
Fixed build.
AlexeyKuznetsov-DD Mar 27, 2026
eaf7d2c
Other JDKs added
AlexeyKuznetsov-DD Mar 27, 2026
0e25abd
Added JDK 25 and updated other JDKs to latest.
AlexeyKuznetsov-DD Mar 27, 2026
073fff8
Merge branch 'master' into alexeyk/test-base-windows
AlexeyKuznetsov-DD Mar 30, 2026
c17176c
ARM64 POC test.
AlexeyKuznetsov-DD Mar 30, 2026
75b51ee
Missing git
AlexeyKuznetsov-DD Mar 30, 2026
4f693f1
WIP
AlexeyKuznetsov-DD Mar 31, 2026
c44f94a
Attempt to fix container setup
AlexeyKuznetsov-DD Mar 31, 2026
ca702f5
Refactor fix by using charsets explicitly.
AlexeyKuznetsov-DD Mar 31, 2026
df8d6c4
Fixed tests for arm64
AlexeyKuznetsov-DD Mar 31, 2026
e89fa15
wip
AlexeyKuznetsov-DD Apr 1, 2026
927fd0a
Merge branch 'master' into alexeyk/test-base-windows
AlexeyKuznetsov-DD Apr 1, 2026
df99d3c
wip
AlexeyKuznetsov-DD Apr 1, 2026
471763d
wip
AlexeyKuznetsov-DD Apr 1, 2026
81d7635
Fixed issues with git and test.
AlexeyKuznetsov-DD Apr 1, 2026
336672d
Merge branch 'master' into alexeyk/test-base-windows
AlexeyKuznetsov-DD Apr 1, 2026
82f4c2d
Fixed `arm64` test failures and clean up related code.
AlexeyKuznetsov-DD Apr 1, 2026
0d501a8
Minor comment.
AlexeyKuznetsov-DD Apr 1, 2026
80de346
wip
AlexeyKuznetsov-DD Apr 1, 2026
a6931d1
Merge branch 'master' into alexeyk/test-base-arm64-fixes
AlexeyKuznetsov-DD Apr 1, 2026
70ca196
Merge branch 'master' into alexeyk/test-base-windows
AlexeyKuznetsov-DD Apr 1, 2026
23da3ec
Fixed review notes.
AlexeyKuznetsov-DD Apr 1, 2026
2f7d96c
Fixed review notes.
AlexeyKuznetsov-DD Apr 1, 2026
39d5106
Merge branch 'alexeyk/test-base-arm64-fixes' into alexeyk/test-base-w…
AlexeyKuznetsov-DD Apr 1, 2026
90edeb4
Attempt to run test_inst on arm64
AlexeyKuznetsov-DD Apr 1, 2026
fc166ca
Fixed UTF const.
AlexeyKuznetsov-DD Apr 1, 2026
eedf1a5
Fixed arm64 support.
AlexeyKuznetsov-DD Apr 1, 2026
b97b0fb
Fixed failed tests.
AlexeyKuznetsov-DD Apr 2, 2026
7d5709d
Fixed failed tests.
AlexeyKuznetsov-DD Apr 5, 2026
840fcdd
Merge remote-tracking branch 'origin/master' into alexeyk/test-base-w…
AlexeyKuznetsov-DD Apr 16, 2026
c4a5684
Merge branch 'master' into alexeyk/test-base-windows
AlexeyKuznetsov-DD Apr 16, 2026
4698499
Ignore SqlServer on arm46 Linux
AlexeyKuznetsov-DD Apr 17, 2026
482ade9
Ignore protobuf on arm64 Linux.
AlexeyKuznetsov-DD Apr 17, 2026
1d51baf
Ignore aerospike on arm64 Linux.
AlexeyKuznetsov-DD Apr 17, 2026
9da667d
Codex generated patch for failed test under arm64.
AlexeyKuznetsov-DD Apr 17, 2026
620358a
Merge branch 'master' into alexeyk/test-base-windows
AlexeyKuznetsov-DD Apr 17, 2026
205b403
Fixed aerospike tests to run under arm64.
AlexeyKuznetsov-DD Apr 17, 2026
c373e7b
skip openai-java on arm64
AlexeyKuznetsov-DD Apr 17, 2026
e5de02b
Merge branch 'master' into alexeyk/test-base-windows
AlexeyKuznetsov-DD Apr 17, 2026
a10452c
fixes for arm64
AlexeyKuznetsov-DD Apr 17, 2026
58dceac
Merge branch 'master' into alexeyk/test-base-windows
AlexeyKuznetsov-DD Apr 20, 2026
acf62e8
Merge remote-tracking branch 'origin/master' into alexeyk/test-base-w…
AlexeyKuznetsov-DD Apr 23, 2026
fbfc321
Added all other tests on arm64
AlexeyKuznetsov-DD Apr 23, 2026
0501037
Workaround
AlexeyKuznetsov-DD Apr 24, 2026
3d785c8
Attempt to patch mvnStage
AlexeyKuznetsov-DD Apr 24, 2026
be3a791
Fixed build
AlexeyKuznetsov-DD Apr 24, 2026
292c979
Fixed build.
AlexeyKuznetsov-DD Apr 24, 2026
5a6b4e5
Merge branch 'master' into alexeyk/test-base-windows
AlexeyKuznetsov-DD Apr 24, 2026
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
377 changes: 377 additions & 0 deletions .gitlab-ci.yml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import datadog.gradle.plugin.testJvmConstraints.TestJvmConstraintsExtension.Comp
import datadog.gradle.plugin.testJvmConstraints.TestJvmSpec
import datadog.gradle.plugin.testJvmConstraints.isJavaVersionAllowed
import datadog.gradle.plugin.testJvmConstraints.isTestJvmAllowed
import java.util.Locale.getDefault

plugins {
java
Expand Down Expand Up @@ -79,6 +80,19 @@ private fun Test.configureTestJvm(extension: TestJvmConstraintsExtension) {
),
extension.allowReflectiveAccessToJdk
)

// TODO: Codex patch to fix arm64 Linux for ByteBuddy error:
// "Could not self-attach to current VM using external process"
val os = System.getProperty("os.name").lowercase(getDefault())
val arch = System.getProperty("os.arch").lowercase(getDefault())
val arm64 = arch.contains("aarch64") || arch.contains("arm64")

if (os.contains("linux") && arm64) {
conditionalJvmArgs(
JavaVersion.VERSION_1_9,
listOf("-Djdk.attach.allowAttachSelf=true")
)
}
}

// Jacoco plugin is not applied on every project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package datadog.environment;

import static datadog.environment.OperatingSystem.Architecture.ARM64;
import static datadog.environment.OperatingSystem.Type.LINUX;
import static datadog.environment.OperatingSystem.Type.MACOS;
import static datadog.environment.OperatingSystem.Type.WINDOWS;
Expand All @@ -25,6 +26,15 @@ public final class OperatingSystem {

private OperatingSystem() {}

/**
* Checks whether the architecture is arm64.
*
* @return @{@code true} if architecture is arm64, {@code false} otherwise.
*/
public static boolean isArm64() {
return ARCHITECTURE == ARM64;
}

/**
* Checks whether the operating system is Linux based.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package datadog.crashtracking.buildid;

import static datadog.environment.OperatingSystem.Architecture.ARM64;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down Expand Up @@ -138,7 +137,7 @@ private static Stream<Arguments> elfBinaries() {
@MethodSource("elfBinaries")
void testElfBuildIdExtraction(String containerPath, String description) throws Exception {
// TODO: check if arm64 can be supported too.
assumeFalse(OperatingSystem.architecture() == ARM64, "Skipping for arm64");
assumeFalse(OperatingSystem.isArm64(), "Skipping for arm64");
Path localBinary = copyFromContainer(linuxContainer, containerPath);

ElfBuildIdExtractor extractor = new ElfBuildIdExtractor();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.datadog.profiling.controller;

import static datadog.environment.OperatingSystem.Architecture.ARM64;

import datadog.environment.JavaVirtualMachine;
import datadog.environment.OperatingSystem;
import datadog.environment.SystemProperties;
Expand Down Expand Up @@ -243,11 +241,7 @@ private static boolean extractSoFromJar(Path target, StringBuilder sb) throws Ex
.filter(e -> e.getName().contains("libjavaProfiler.so"))
.filter(
e ->
e.getName()
.contains(
OperatingSystem.architecture() == ARM64
? "/linux-arm64/"
: "/linux-x64/")
e.getName().contains(OperatingSystem.isArm64() ? "/linux-arm64/" : "/linux-x64/")
&& (!OperatingSystem.isMusl() || e.getName().contains("-musl")))
.findFirst()
.map(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package datadog.trace.instrumentation.aerospike4

import static org.junit.jupiter.api.Assertions.fail

import com.aerospike.client.AerospikeClient
import com.aerospike.client.AerospikeException
import com.aerospike.client.Bin
Expand All @@ -9,27 +11,23 @@ import com.aerospike.client.async.NioEventLoops
import com.aerospike.client.listener.WriteListener
import com.aerospike.client.policy.ClientPolicy
import datadog.trace.api.Config
import spock.lang.Shared

import static org.junit.jupiter.api.Assertions.fail

abstract class AerospikeAsyncClientTest extends AerospikeBaseTest {

@Shared
AerospikeClient client

@Shared
EventLoops eventLoops = new NioEventLoops(1)
private AerospikeClient client
private EventLoops eventLoops

def setup() throws Exception {
eventLoops = new NioEventLoops(1)

ClientPolicy clientPolicy = new ClientPolicy()
clientPolicy.eventLoops = eventLoops

client = new AerospikeClient(clientPolicy, aerospikeHost, aerospikePort)
}

def cleanup() throws Exception {
client.close()
eventLoops.close()
client?.close()
eventLoops?.close()
}

def "test put then get"() {
Expand Down Expand Up @@ -95,4 +93,3 @@ class AerospikeAsyncClientV1ForkedTest extends AerospikeAsyncClientTest {
return "aerospike.query"
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package datadog.trace.instrumentation.aerospike4

import static datadog.environment.OperatingSystem.isArm64
import static datadog.environment.OperatingSystem.isLinux
import static datadog.trace.agent.test.utils.PortUtils.waitForPortToOpen
import static java.util.concurrent.TimeUnit.SECONDS
import static org.junit.jupiter.api.Assumptions.assumeFalse
import static org.testcontainers.containers.wait.strategy.Wait.forLogMessage

import datadog.trace.agent.test.asserts.TraceAssert
import datadog.trace.agent.test.naming.VersionedNamingTestBase
Expand All @@ -9,10 +15,6 @@ import datadog.trace.core.DDSpan
import org.testcontainers.containers.GenericContainer
import spock.lang.Shared

import static datadog.trace.agent.test.utils.PortUtils.waitForPortToOpen
import static java.util.concurrent.TimeUnit.SECONDS
import static org.testcontainers.containers.wait.strategy.Wait.forLogMessage

abstract class AerospikeBaseTest extends VersionedNamingTestBase {

@Shared
Expand All @@ -25,6 +27,9 @@ abstract class AerospikeBaseTest extends VersionedNamingTestBase {
int aerospikePort = 3000

def setup() throws Exception {
// TODO: skip aerospike under arm46 Linux, as supported since ce-6.2.0.2 only
assumeFalse(isArm64() && isLinux())

aerospike = new GenericContainer('aerospike:5.5.0.9')
.withExposedPorts(3000)
.waitingFor(forLogMessage(".*heartbeat-received.*\\n", 1))
Expand All @@ -37,9 +42,7 @@ abstract class AerospikeBaseTest extends VersionedNamingTestBase {
}

def cleanup() throws Exception {
if (aerospike) {
aerospike.stop()
}
aerospike?.stop()
}

def aerospikeSpan(TraceAssert trace, int index, String methodName, Object parentSpan = null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@ import com.aerospike.client.AerospikeClient
import com.aerospike.client.Bin
import com.aerospike.client.Key
import datadog.trace.api.Config
import spock.lang.Shared

abstract class AerospikeClientTest extends AerospikeBaseTest {

@Shared
AerospikeClient client
private AerospikeClient client

def setup() throws Exception {
client = new AerospikeClient(aerospikeHost, aerospikePort)
}

def cleanup() throws Exception {
client.close()
client?.close()
}

def "test put then get"() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,20 @@ tasks.named("test", Test) {
dependsOn "test_before_1_11_106"
}

def isLinuxArm64 = {
def os = System.getProperty("os.name").toLowerCase()
def arch = System.getProperty("os.arch").toLowerCase()
os.contains("linux") && (arch.contains("arm64") || arch.contains("aarch64"))
}

tasks.withType(Test).configureEach {
if ((name == "forkedTest" || name.endsWith("ForkedTest"))
&& isLinuxArm64()) {
// TODO: Remove this Linux arm64 workaround once the forked AWS SDK 1.11 tests are stable there.
maxParallelForks = 1
}
}

tasks.named("forkedTest", Test) {
dependsOn "test_before_1_11_106ForkedTest"
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,8 @@ dependencies {
latestDepTestImplementation group: 'com.couchbase.client', name: 'java-client', version: '2.+'
latestDepTestImplementation group: 'com.couchbase.client', name: 'encryption', version: '+'
}

tasks.withType(Test).configureEach {
// same setting as agent-tooling to avoid Byte Buddy/ConfigTransformSpockExtension failures on newer JDKs
jvmArgs += ["-Dnet.bytebuddy.raw=true"]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import static datadog.trace.agent.test.utils.TraceUtils.basicSpan

import com.google.api.gax.core.NoCredentialsProvider
Expand Down Expand Up @@ -34,13 +33,12 @@ import datadog.trace.core.datastreams.StatsGroup
import datadog.trace.instrumentation.grpc.client.GrpcClientDecorator
import io.grpc.ManagedChannel
import io.grpc.ManagedChannelBuilder
import java.nio.charset.StandardCharsets
import java.util.concurrent.CountDownLatch
import org.testcontainers.containers.PubSubEmulatorContainer
import org.testcontainers.utility.DockerImageName
import spock.lang.Shared

import java.nio.charset.StandardCharsets
import java.util.concurrent.CountDownLatch

abstract class PubSubTest extends VersionedNamingTestBase {
private static final String PROJECT_ID = "dd-trace-java"

Expand Down Expand Up @@ -97,7 +95,7 @@ abstract class PubSubTest extends VersionedNamingTestBase {
}

def setupSpec() {
emulator = new PubSubEmulatorContainer(DockerImageName.parse("gcr.io/google.com/cloudsdktool/cloud-sdk:495.0.0-emulators"))
emulator = new PubSubEmulatorContainer(DockerImageName.parse("gcr.io/google.com/cloudsdktool/google-cloud-cli:495.0.0-emulators"))
emulator.start()
channel = ManagedChannelBuilder.forTarget(emulator.getEmulatorEndpoint()).usePlaintext().build()
transportChannelProvider = FixedTransportChannelProvider.create(GrpcTransportChannel.create(channel))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package executor

import static datadog.environment.OperatingSystem.arm64
import static datadog.environment.OperatingSystem.linux
import static org.junit.jupiter.api.Assumptions.assumeTrue

import datadog.trace.agent.test.InstrumentationSpecification
import datadog.trace.api.Trace
import datadog.trace.core.DDSpan
Expand All @@ -8,24 +12,18 @@ import io.netty.channel.epoll.EpollEventLoopGroup
import io.netty.channel.local.LocalEventLoopGroup
import io.netty.channel.nio.NioEventLoopGroup
import io.netty.util.concurrent.DefaultEventExecutorGroup
import runnable.JavaAsyncChild
import spock.lang.Shared

import java.lang.reflect.InvocationTargetException
import java.util.concurrent.Callable
import java.util.concurrent.Future
import java.util.concurrent.RejectedExecutionException
import java.util.concurrent.TimeUnit

import static org.junit.jupiter.api.Assumptions.assumeTrue
import runnable.JavaAsyncChild
import spock.lang.Shared

class NettyExecutorInstrumentationTest extends InstrumentationSpecification {

@Shared
boolean isLinux = System.getProperty("os.name").toLowerCase().contains("linux")

// TODO: check if arm64 can be supported too.
@Shared
EpollEventLoopGroup epollEventLoopGroup = isLinux ? new EpollEventLoopGroup(4) : null
EpollEventLoopGroup epollEventLoopGroup = (isLinux() && !isArm64()) ? new EpollEventLoopGroup(4) : null
@Shared
DefaultEventExecutorGroup defaultEventExecutorGroup = new DefaultEventExecutorGroup(4)
@Shared
Expand Down Expand Up @@ -279,6 +277,6 @@ class NettyExecutorInstrumentationTest extends InstrumentationSpecification {

def epollExecutor() {
// EPoll only works on linux
isLinux ? epollEventLoopGroup.next() : null
epollEventLoopGroup?.next()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ class StringConcatFactoryCallSiteTest extends InstrumentationSpecification {
setup:
StringModule iastModule = Mock(StringModule)
InstrumentationBridge.registerIastModule(iastModule)
final expected = '𠆢Hello𠆢\u0001𠆢World!.'
// 𠆢Hello...
final expected = '\uD840\uDDA2Hello\uD840\uDDA2\u0001\uD840\uDDA2World!.'

when:
final result = TestStringConcatFactorySuite.plusWithUtfConstants('Hello', 'World!')
Expand All @@ -157,8 +158,8 @@ class StringConcatFactoryCallSiteTest extends InstrumentationSpecification {
1 * iastModule.onStringConcatFactory(
expected,
['Hello', 'World!'] as String[],
'𠆢\u0001\u0002\u0001.',
['𠆢\u0001𠆢'] as Object[],
'\uD840\uDDA2\u0001\u0002\u0001.',
['\uD840\uDDA2\u0001\uD840\uDDA2'] as Object[],
[-2, 0, -5, 1, -1] as int[])
0 * _
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.slf4j.LoggerFactory;

public abstract class TestStringConcatFactorySuite {

private static final Logger LOGGER = LoggerFactory.getLogger(TestStringConcatFactorySuite.class);

private TestStringConcatFactorySuite() {}
Expand Down Expand Up @@ -33,7 +32,8 @@ public static String plusWithConstantsAndTags(final String left, final String ri

public static String plusWithUtfConstants(final String left, final String right) {
LOGGER.debug("Before string plus {} {}", left, right);
final String result = "𠆢" + left + "𠆢\u0001𠆢" + right + ".";
// 𠆢 + left + ...
final String result = "\uD840\uDDA2" + left + "\uD840\uDDA2\u0001\uD840\uDDA2" + right + ".";
LOGGER.debug("After string plus {}", result);
return result;
}
Expand All @@ -50,7 +50,8 @@ public static String stringPlusWithMultipleObjects(final Object... target) {
LOGGER.debug("Before string plus {}", Arrays.toString(target));
String result = "";
for (final Object item : target) {
result += item;
//noinspection StringConcatenationInLoop
result += item; // intentional `+` in loop for test.
}
LOGGER.debug("After string plus {}", result);
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ import datadog.trace.api.iast.InstrumentationBridge
import datadog.trace.api.iast.propagation.CodecModule
import datadog.trace.api.iast.propagation.PropagationModule
import foo.bar.TestURLEncoderCallSiteSuite
import java.nio.charset.Charset

class URLEncoderCallSiteTest extends InstrumentationSpecification {
// Explicit escape for non-ASCII `ståle` to make test independent of container settings.
private static final String NON_ASCII_QUERY = 'my test.asp?name=st\u00E5le&car=saab'
private static final String DEFAULT_CHARSET_ENCODED =
URLEncoder.encode(NON_ASCII_QUERY, Charset.defaultCharset().name())

@Override
protected void configurePreAgent() {
Expand All @@ -27,9 +32,9 @@ class URLEncoderCallSiteTest extends InstrumentationSpecification {
0 * _

where:
args | expected
['my test.asp?name=ståle&car=saab'] | 'my+test.asp%3Fname%3Dst%C3%A5le%26car%3Dsaab'
['my test.asp?name=ståle&car=saab', 'UTF-8'] | 'my+test.asp%3Fname%3Dst%C3%A5le%26car%3Dsaab'
args | expected
[NON_ASCII_QUERY] | DEFAULT_CHARSET_ENCODED
[NON_ASCII_QUERY, 'UTF-8'] | 'my+test.asp%3Fname%3Dst%C3%A5le%26car%3Dsaab'
}

void 'test encode with null args'() {
Expand Down
Loading
Loading