diff --git a/buildSrc/src/main/groovy/com/carrotsearch/gradle/junit4/RandomizedTestingTask.groovy b/buildSrc/src/main/groovy/com/carrotsearch/gradle/junit4/RandomizedTestingTask.groovy index 723f67f0298..e40bf83454b 100644 --- a/buildSrc/src/main/groovy/com/carrotsearch/gradle/junit4/RandomizedTestingTask.groovy +++ b/buildSrc/src/main/groovy/com/carrotsearch/gradle/junit4/RandomizedTestingTask.groovy @@ -61,6 +61,11 @@ class RandomizedTestingTask extends DefaultTask { ListenersConfiguration listenersConfig = new ListenersConfiguration(task: this) List jvmArgs = new ArrayList<>() + + @Optional + @Input + String argLine = null + Map systemProperties = new HashMap<>() PatternFilterable patternSet = new PatternSet() @@ -193,6 +198,9 @@ class RandomizedTestingTask extends DefaultTask { for (String arg : jvmArgs) { jvmarg(value: arg) } + if (argLine != null) { + jvmarg(line: argLine) + } fileset(dir: testClassesDir) { for (String includePattern : patternSet.getIncludes()) { include(name: includePattern) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy index 6ed1553dceb..fb1e9ec9722 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy @@ -111,6 +111,7 @@ class BuildPlugin implements Plugin { File heapdumpDir = new File(project.buildDir, 'heapdump') heapdumpDir.mkdirs() jvmArg '-XX:HeapDumpPath=' + heapdumpDir + argLine System.getProperty('tests.jvm.argline') // we use './temp' since this is per JVM and tests are forbidden from writing to CWD systemProperty 'java.io.tmpdir', './temp'