Skip to content

Commit

Permalink
BlockHound and debug agent tests use toolchains (#3919)
Browse files Browse the repository at this point in the history
Running BlockHound and debug agent tests using JDK greater than 8 would
fail due to improper version checks. `JavaVersion.current()` reports the
JDK used to run gradle, while we are interested in the JDK currently in
use by the current toolchain.

Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
  • Loading branch information
chemicL authored Nov 8, 2024
1 parent 3473c9f commit 38f9628
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions reactor-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,10 @@ if (!JavaVersion.current().isJava9Compatible()) {
}
}

if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_13)) {
blockHoundTest {
jvmArgs = ["-XX:+AllowRedefinitionToAddDeleteMethods"]
}
blockHoundTest {
if (javaLauncher.get().metadata.languageVersion.canCompileOrRun(13)) {
jvmArgs = ["-XX:+AllowRedefinitionToAddDeleteMethods"]
}
}

jar {
Expand Down
4 changes: 2 additions & 2 deletions reactor-tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ test {
maxParallelForks = 1
jvmArgs = [
"-Xverify:all",
JavaVersion.current().isJava9Compatible()
javaLauncher.get().metadata.languageVersion.canCompileOrRun(9)
? "-Xlog:redefine+class*=warning"
: "-XX:TraceRedefineClasses=2"
]
Expand Down Expand Up @@ -181,7 +181,7 @@ javaAgentTest {
jvmArgs = [
"-javaagent:${shadowJar.outputs.files.singleFile}",
"-Xverify:all",
JavaVersion.current().isJava9Compatible()
javaLauncher.get().metadata.languageVersion.canCompileOrRun(9)
? "-Xlog:redefine+class*=warning"
: "-XX:TraceRedefineClasses=2"
]
Expand Down

0 comments on commit 38f9628

Please sign in to comment.