Skip to content

Commit

Permalink
explicitly enable dynamic agent loading in tests
Browse files Browse the repository at this point in the history
Prevents lots of warnings like these:

    WARNING: A Java agent has been loaded dynamically (/home/.../
    .gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy-agent/1.14.11/f9cb566608fbac6bc7bf54901a7aa11543a989ee/byte-buddy-agent-1.14.11.jar)
    WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning
    WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information
    WARNING: Dynamic loading of agents will be disallowed by default in a future release
  • Loading branch information
wojciech-adaptive committed Feb 5, 2024
1 parent 122d712 commit 5c2068d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ subprojects {
jvmArgs('--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED')
jvmArgs('--add-opens', 'java.base/java.util.zip=ALL-UNNAMED')
}

if (buildJavaVersion >= 21) {
jvmArgs('-XX:+EnableDynamicAgentLoading')
}

testClassesDirs = testing.suites.test.sources.output.classesDirs
classpath = testing.suites.test.sources.runtimeClasspath

Expand Down

0 comments on commit 5c2068d

Please sign in to comment.