allow for write.lock (NativeFSLF leaves this) too

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1625806 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2014-09-17 20:29:14 +00:00
parent e428fb2c9a
commit f2b2a710cd
1 changed files with 4 additions and 2 deletions

View File

@ -2426,7 +2426,10 @@ public class TestIndexWriter extends LuceneTestCase {
if (dir instanceof MockDirectoryWrapper) {
MockDirectoryWrapper mdw = (MockDirectoryWrapper) dir;
if (Arrays.equals(new String[] {"segments_0"}, dir.listAll()) &&
String[] files = dir.listAll();
Arrays.sort(files);
if ((Arrays.equals(new String[] {"segments_0"}, files) ||
Arrays.equals(new String[] {"segments_0", "write.lock"}, files)) &&
mdw.didTryToDelete("segments_0")) {
// This means virus checker blocked IW deleting the corrupt first commit
dir.setCheckIndexOnClose(false);
@ -2731,7 +2734,6 @@ public class TestIndexWriter extends LuceneTestCase {
IndexWriterConfig iwc = new IndexWriterConfig(null);
iwc.setInfoStream(slowCommittingInfoStream);
final IndexWriter iw = new IndexWriter(dir, iwc);
Document doc = new Document();
new Thread() {
@Override
public void run() {