Closed staktrace closed 2 weeks ago
Hi @staktrace, thank you for reporting this!
The error occurs because in your plugin tests you're initiating a Gradle build, and the tracer tries to instrument this build as if it was a regular Gradle invocation.
Normally this type of "build-inside-a-build" situation is handled by the tracer automatically, but since your setup is somewhat non-standard (as far as I recall you're injecting the tracer into the test tasks by hand) additional steps are required.
Could you please try adding the following property to your test tasks' JVM args and let me know if that helps?
-Ddd.civisibility.build.instrumentation.enabled=false
Thanks!
Setting that property does get the tests passing, yes. Is this something that's safe to apply on all test tasks in our shared build-logic code? Or should it generally be restricted to gradle plugin modules?
This is safe to apply everywhere. All it does is disable Gradle/Maven instrumentation, which you don't need given that you're already tracing the JVMs that execute tests.
Great, thank you! In that case feel free to close out this issue. 🙇
Same datadog setup as in https://github.com/DataDog/dd-trace-java/issues/7521, but using dd-java-agent version 1.39.0. We have a gradle module that creates a gradle plugin. The test for the plugin looks like this:
when this test is run with the datadog agent, we get an exception stack like this:
I guess that the DD agent code is calling
getStartParameter()
on the project object but the project object is coming from the gradle testFixtures and doesn't have a start paramater? I'm not really sure.If this information is insufficient to reproduce the problem I can try to make a sanitized standalone reproducer - please let me know!