Skip to content

Commit fdfb195

Browse files
committed
Allow individual projects to override test heapdump setting (#50096)
This commit goes from using a JvmArgumentProvider to using the normal Test task APIs for passing the `HeapDumpOnOutOfMemoryError` JVM argument. This makes it simpler for subprojects, such as lang-painless to override this setting if necessary. Closes #49117 (cherry picked from commit e97c38f)
1 parent 38b67f7 commit fdfb195

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,9 +680,10 @@ class BuildPlugin implements Plugin<Project> {
680680
test.exclude '**/*$*.class'
681681

682682
test.jvmArgs "-Xmx${System.getProperty('tests.heap.size', '512m')}",
683-
"-Xms${System.getProperty('tests.heap.size', '512m')}"
683+
"-Xms${System.getProperty('tests.heap.size', '512m')}",
684+
'-XX:+HeapDumpOnOutOfMemoryError'
684685

685-
test.jvmArgumentProviders.add({ ['-XX:+HeapDumpOnOutOfMemoryError', "-XX:HeapDumpPath=$heapdumpDir"] } as CommandLineArgumentProvider)
686+
test.jvmArgumentProviders.add({ ["-XX:HeapDumpPath=$heapdumpDir"] } as CommandLineArgumentProvider)
686687

687688
if (System.getProperty('tests.jvm.argline')) {
688689
test.jvmArgs System.getProperty('tests.jvm.argline').split(" ")

0 commit comments

Comments
 (0)