Skip to content

Commit 6ed3311

Browse files
committed
Ensure test temporary directory exists (#52227)
Today we we set the test temporary directory explicitly by controling java.io.tmpdir. Yet, we do not guarantee this directory exists, instead relying on a test base class (LuceneTestCase) to create this directory when it initializes. However, some of our tests do not rely on our test framework, and thus do not have access to LuceneTestCase, instead relying on RandomizedRunner directly. We should not be relying on the temporary directory being implicitly created, instead guaranteeing that it exists before test execution starts. This commit does that by creating the test temporary directory before the test task executes (via a doFirst).
1 parent 0372d6d commit 6ed3311

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,7 @@ class BuildPlugin implements Plugin<Project> {
694694
project.mkdir(testOutputDir)
695695
project.mkdir(heapdumpDir)
696696
project.mkdir(test.workingDir)
697+
project.mkdir(test.workingDir.toPath().resolve('temp'))
697698

698699
if (BuildParams.runtimeJavaVersion >= JavaVersion.VERSION_1_9) {
699700
test.jvmArgs '--illegal-access=warn'

0 commit comments

Comments
 (0)