diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy index a303a39187319..46671b4dd7d05 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy @@ -686,16 +686,13 @@ class BuildPlugin implements Plugin { test.jvmArgs '-ea', '-esa' } - // we use './temp' since this is per JVM and tests are forbidden from writing to CWD - test.systemProperties 'java.io.tmpdir': './temp', - 'java.awt.headless': 'true', + test.systemProperties 'java.awt.headless': 'true', 'tests.gradle': 'true', 'tests.artifact': project.name, 'tests.task': test.path, 'tests.security.manager': 'true', 'jna.nosys': 'true' - // ignore changing test seed when build is passed -Dignore.tests.seed for cacheability experimentation if (System.getProperty('ignore.tests.seed') != null) { nonInputProperties.systemProperty('tests.seed', BuildParams.testSeed) @@ -707,6 +704,8 @@ class BuildPlugin implements Plugin { nonInputProperties.systemProperty('gradle.dist.lib', new File(project.class.location.toURI()).parent) nonInputProperties.systemProperty('gradle.worker.jar', "${project.gradle.getGradleUserHomeDir()}/caches/${project.gradle.gradleVersion}/workerMain/gradle-worker.jar") nonInputProperties.systemProperty('gradle.user.home', project.gradle.getGradleUserHomeDir()) + // we use 'temp' relative to CWD since this is per JVM and tests are forbidden from writing to CWD + nonInputProperties.systemProperty('java.io.tmpdir', test.workingDir.toPath().resolve('temp')) nonInputProperties.systemProperty('compiler.java', "${-> BuildParams.compilerJavaVersion.majorVersion}")