Skip to content

Commit e531ab5

Browse files
authored
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 208cbc2 commit e531ab5

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
@@ -655,6 +655,7 @@ class BuildPlugin implements Plugin<Project> {
655655
project.mkdir(testOutputDir)
656656
project.mkdir(heapdumpDir)
657657
project.mkdir(test.workingDir)
658+
project.mkdir(test.workingDir.toPath().resolve('temp'))
658659

659660
//TODO remove once jvm.options are added to test system properties
660661
test.systemProperty ('java.locale.providers','SPI,COMPAT')

0 commit comments

Comments
 (0)