Skip to content

Commit de593cc

Browse files
authored
Limit net.bytebuddy.raw fix to agent-tooling, to avoid causing test side-effects elsewhere (#8732)
1 parent 511416f commit de593cc

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

dd-java-agent/agent-tooling/build.gradle

+6
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,9 @@ project.tasks.compileTest_java11Java.configure {
8989
final jmh = project.tasks.jmh
9090
jmh.outputs.upToDateWhen { false }
9191
jmh.dependsOn(compileTestJava)
92+
93+
tasks.withType(Test).configureEach {
94+
// same setting as AgentInstaller to avoid spurious agent-tooling test failures
95+
// caused by ConfigTransformSpockExtension installing byte-buddy during testing
96+
jvmArgs += ["-Dnet.bytebuddy.raw=true"]
97+
}

utils/test-utils/src/main/groovy/datadog/trace/test/util/ConfigTransformSpockExtension.groovy

-5
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ import static net.bytebuddy.matcher.ElementMatchers.none
1818
* Transforms the Config class to make its INSTANCE field non-final and volatile.
1919
*/
2020
class ConfigTransformSpockExtension implements IGlobalExtension {
21-
static {
22-
// same setting as AgentInstaller to avoid spurious agent-tooling test failures
23-
System.setProperty("net.bytebuddy.raw", "true")
24-
}
25-
2621
static final String INST_CONFIG = "datadog.trace.api.InstrumenterConfig"
2722
static final String CONFIG = "datadog.trace.api.Config"
2823

0 commit comments

Comments
 (0)