You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2014/09/17 22:28:23 UTC
svn commit: r1625805 -
/lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
Author: mikemccand
Date: Wed Sep 17 20:28:22 2014
New Revision: 1625805
URL: http://svn.apache.org/r1625805
Log:
allow for write.lock (NativeFSLF leaves this) too
Modified:
lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
Modified: lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=1625805&r1=1625804&r2=1625805&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java (original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java Wed Sep 17 20:28:22 2014
@@ -24,7 +24,6 @@ import java.io.Reader;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -32,7 +31,6 @@ import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.MockAnalyzer;
@@ -2414,7 +2412,10 @@ public class TestIndexWriter extends Luc
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);
@@ -2712,7 +2713,6 @@ public class TestIndexWriter extends Luc
IndexWriterConfig iwc = new IndexWriterConfig(Version.LATEST, null);
iwc.setInfoStream(slowCommittingInfoStream);
final IndexWriter iw = new IndexWriter(dir, iwc);
- Document doc = new Document();
new Thread() {
@Override
public void run() {