LUCENE-10482 Bug Fix: Don't use Instant.now() as prefix for the temp dir name (#814)

* Don't use Instant.now() as prefix for the temp dir name

* spotless
This commit is contained in:
Gautam Worah 2022-04-17 18:18:08 -07:00 committed by GitHub
parent 10ebc099c8
commit d322be52f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -21,7 +21,6 @@ import static org.apache.lucene.tests.mockfile.ExtrasFS.isExtra;
import java.io.IOException;
import java.nio.file.Path;
import java.time.Instant;
import java.util.List;
import java.util.function.Function;
import org.apache.lucene.facet.FacetTestCase;
@ -53,7 +52,7 @@ public class TestAlwaysRefreshDirectoryTaxonomyReader extends FacetTestCase {
private <T extends Throwable> void testAlwaysRefreshDirectoryTaxonomyReader(
Function<Directory, DirectoryTaxonomyReader> dtrProducer, Class<T> exceptionType)
throws IOException {
final Path taxoPath1 = createTempDir(String.valueOf(Instant.now()));
final Path taxoPath1 = createTempDir();
final Directory dir1 = newFSDirectory(taxoPath1);
final DirectoryTaxonomyWriter tw1 =
@ -61,7 +60,7 @@ public class TestAlwaysRefreshDirectoryTaxonomyReader extends FacetTestCase {
tw1.addCategory(new FacetLabel("a"));
tw1.commit(); // commit1
final Path taxoPath2 = createTempDir(String.valueOf(Instant.now()));
final Path taxoPath2 = createTempDir();
final Directory commit1 = newFSDirectory(taxoPath2);
// copy all index files from dir1
for (String file : dir1.listAll()) {