Skip to content

Commit

Permalink
Set JVM options for running tests on compute server.
Browse files Browse the repository at this point in the history
These activate by using
./gradlew -Pserver=smirnov
  • Loading branch information
Mikael Vejdemo-Johansson committed Nov 8, 2023
1 parent da80f44 commit ce4207b
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,21 @@ kotlin {
withJava()
testRuns["test"].executionTask.configure {
useJUnitPlatform()
if (hasProperty("server") and (property("server") == "smirnov")) {
// set heap size for the test JVM(s)
minHeapSize = "1024m"
maxHeapSize = "8192m"
if (hasProperty("server")) {
if (property("server") == "smirnov") {
// set heap size for the test JVM(s)
minHeapSize = "1024m"
maxHeapSize = "8192m"

// set JVM arguments for the test JVM(s)
jvmArgs(
listOf(
"-XX:+HeapDumpOnOutOfMemoryError",
"-XX:HeapDumpPath=heapdump.hprof",
"-XX:StartFlightRecording=disk=true,dumponexit=true,filename=recording.jfr,maxsize=16384m,maxage=7d,settings=profile,path-to-gc-roots=true",
),
)
// set JVM arguments for the test JVM(s)
jvmArgs(
listOf(
"-XX:+HeapDumpOnOutOfMemoryError",
"-XX:HeapDumpPath=heapdump.hprof",
"-XX:StartFlightRecording=disk=true,dumponexit=true,filename=recording.jfr,maxsize=16384m,maxage=7d,settings=profile,path-to-gc-roots=true",
),
)
}
}
}
}
Expand Down

0 comments on commit ce4207b

Please sign in to comment.