Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
import org.apache.lucene.store.AlreadyClosedException;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexInput;
Expand All @@ -41,11 +42,6 @@
import org.apache.lucene.tests.util.TestUtil;
import org.apache.lucene.util.InfoStream;

/*
Verify we can read the pre-2.1 file format, do searches
against it, and add documents to it.
*/

public class TestIndexFileDeleter extends LuceneTestCase {

public void testDeleteLeftoverFiles() throws IOException {
Expand Down Expand Up @@ -440,7 +436,6 @@ public void eval(MockDirectoryWrapper dir) throws IOException {
});

IndexWriterConfig iwc = newIndexWriterConfig(new MockAnalyzer(random()));
// iwc.setMergeScheduler(new SerialMergeScheduler());
MergeScheduler ms = iwc.getMergeScheduler();
if (ms instanceof ConcurrentMergeScheduler) {
final ConcurrentMergeScheduler suppressFakeFail =
Expand Down Expand Up @@ -486,8 +481,12 @@ protected void handleMergeException(Throwable exc) {
}
} catch (Throwable t) {
if (t.toString().contains("fake fail")
|| (t.getCause() != null && t.getCause().toString().contains("fake fail"))) {
// ok
|| (t.getCause() != null && t.getCause().toString().contains("fake fail"))
|| t instanceof AlreadyClosedException) {
// All these conditions are fine.
// AlreadyClosedException can happen if the injected exception (RuntimeException("fake
// fail")) happened inside the concurrent merges and this closed the index writer's
// reader pool.
} else {
throw t;
}
Expand Down