diff --git a/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java b/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java index d44cf8e7859..bf32c25eea5 100644 --- a/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java +++ b/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java @@ -625,14 +625,20 @@ public class TestIndexWriterDelete extends LuceneTestCase { MockDirectoryWrapper.Failure failure = new MockDirectoryWrapper.Failure() { boolean sawMaybe = false; boolean failed = false; + Thread thread; @Override public MockDirectoryWrapper.Failure reset() { + thread = Thread.currentThread(); sawMaybe = false; failed = false; return this; } @Override public void eval(MockDirectoryWrapper dir) throws IOException { + if (Thread.currentThread() != thread) { + // don't fail during merging + return; + } if (sawMaybe && !failed) { boolean seen = false; StackTraceElement[] trace = new Exception().getStackTrace();