LUCENE-6265: fix test bug

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1661286 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2015-02-21 05:36:33 +00:00
parent 7c36d012f6
commit 2ef79962a7
1 changed files with 4 additions and 2 deletions

View File

@ -135,8 +135,10 @@ public class TestIndexWriterOutOfFileDescriptors extends LuceneTestCase {
dirCopy = newMockFSDirectory(createTempDir("TestIndexWriterOutOfFileDescriptors.copy"));
Set<String> files = new HashSet<>();
for (String file : dir.listAll()) {
dirCopy.copyFrom(dir, file, file, IOContext.DEFAULT);
files.add(file);
if (file.startsWith(IndexFileNames.SEGMENTS) || IndexFileNames.CODEC_FILE_PATTERN.matcher(file).matches()) {
dirCopy.copyFrom(dir, file, file, IOContext.DEFAULT);
files.add(file);
}
}
dirCopy.sync(files);
// Have IW kiss the dir so we remove any leftover