From fdfb1950fcc9c11b57b25282d1302a9ee18d2b07 Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Wed, 11 Dec 2019 15:39:06 -0800 Subject: [PATCH] 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 e97c38ff8e862abdc1d7816c66f9869ed216031f) --- .../main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy index 6b0d3768598..58a80fbd22f 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy @@ -680,9 +680,10 @@ class BuildPlugin implements Plugin { test.exclude '**/*$*.class' test.jvmArgs "-Xmx${System.getProperty('tests.heap.size', '512m')}", - "-Xms${System.getProperty('tests.heap.size', '512m')}" + "-Xms${System.getProperty('tests.heap.size', '512m')}", + '-XX:+HeapDumpOnOutOfMemoryError' - test.jvmArgumentProviders.add({ ['-XX:+HeapDumpOnOutOfMemoryError', "-XX:HeapDumpPath=$heapdumpDir"] } as CommandLineArgumentProvider) + test.jvmArgumentProviders.add({ ["-XX:HeapDumpPath=$heapdumpDir"] } as CommandLineArgumentProvider) if (System.getProperty('tests.jvm.argline')) { test.jvmArgs System.getProperty('tests.jvm.argline').split(" ")