Test: Remove use of globalTempDir() and forbid it from future use.

Using this temp dir circumvents test isolation and isn't necessary.

closes #9777
This commit is contained in:
Ryan Ernst 2015-02-19 13:47:44 -08:00
parent 16446440e4
commit dae0ed168a
3 changed files with 3 additions and 8 deletions

View File

@ -0,0 +1,2 @@
com.carrotsearch.randomizedtesting.RandomizedTest#globalTempDir() @ Use newTempDirPath() instead

View File

@ -92,7 +92,7 @@ public class FileSystemUtilsTests extends ElasticsearchTestCase {
@Test
public void testMoveOverExistingFileAndIgnore() throws IOException {
Path dest = globalTempDirPath();
Path dest = newTempDirPath();
FileSystemUtils.moveFilesWithoutOverwriting(src.resolve("v1"), dest, null);
assertFileContent(dest, "file1.txt", "version1");

View File

@ -557,13 +557,6 @@ public abstract class ElasticsearchTestCase extends AbstractRandomizedTest {
public static Path newTempDirPath(LifecycleScope scope) {
return newTempDir(scope).toPath();
}
/**
* Returns 'global' temp dir (seems like a bad idea)
*/
public static Path globalTempDirPath() {
return globalTempDir().toPath();
}
/**
* Returns a random number of temporary paths.