mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 02:14:54 +00:00
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:
parent
16446440e4
commit
dae0ed168a
@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
com.carrotsearch.randomizedtesting.RandomizedTest#globalTempDir() @ Use newTempDirPath() instead
|
@ -92,7 +92,7 @@ public class FileSystemUtilsTests extends ElasticsearchTestCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMoveOverExistingFileAndIgnore() throws IOException {
|
public void testMoveOverExistingFileAndIgnore() throws IOException {
|
||||||
Path dest = globalTempDirPath();
|
Path dest = newTempDirPath();
|
||||||
|
|
||||||
FileSystemUtils.moveFilesWithoutOverwriting(src.resolve("v1"), dest, null);
|
FileSystemUtils.moveFilesWithoutOverwriting(src.resolve("v1"), dest, null);
|
||||||
assertFileContent(dest, "file1.txt", "version1");
|
assertFileContent(dest, "file1.txt", "version1");
|
||||||
|
@ -557,13 +557,6 @@ public abstract class ElasticsearchTestCase extends AbstractRandomizedTest {
|
|||||||
public static Path newTempDirPath(LifecycleScope scope) {
|
public static Path newTempDirPath(LifecycleScope scope) {
|
||||||
return newTempDir(scope).toPath();
|
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.
|
* Returns a random number of temporary paths.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user