mirror of https://github.com/apache/lucene.git
LUCENE-8163: BaseDirectoryTestCase produces random filenames that fail on Windows
This commit is contained in:
parent
1527ce57d4
commit
342e38217a
|
@ -162,6 +162,9 @@ Bug Fixes
|
|||
* LUCENE-8124: Fixed HyphenationCompoundWordTokenFilter to handle correctly
|
||||
hyphenation patterns with indicator >= 7. (Holger Bruch via Adrien Grand)
|
||||
|
||||
* LUCENE-8163: BaseDirectoryTestCase could produce random filenames that fail
|
||||
on Windows (Alan Woodward)
|
||||
|
||||
Other
|
||||
|
||||
* LUCENE-8111: IndexOrDocValuesQuery Javadoc references outdated method name.
|
||||
|
|
|
@ -1186,10 +1186,8 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
|
|||
int count = atLeast(20);
|
||||
Set<String> names = new HashSet<>();
|
||||
while(names.size() < count) {
|
||||
String name = TestUtil.randomSimpleString(random());
|
||||
if (name.length() == 0) {
|
||||
continue;
|
||||
}
|
||||
// create a random filename (segment file name style), so it cannot hit windows problem with special filenames ("con", "com1",...):
|
||||
String name = IndexFileNames.segmentFileName(TestUtil.randomSimpleString(random(), 1, 6), TestUtil.randomSimpleString(random()), "test");
|
||||
if (random().nextInt(5) == 1) {
|
||||
IndexOutput out = dir.createTempOutput(name, "foo", IOContext.DEFAULT);
|
||||
names.add(out.getName());
|
||||
|
|
Loading…
Reference in New Issue