lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1045310 - /lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
Date Mon, 13 Dec 2010 19:05:24 GMT
Author: mikemccand
Date: Mon Dec 13 19:05:23 2010
New Revision: 1045310

URL: http://svn.apache.org/viewvc?rev=1045310&view=rev
Log:
LUCENE-2813: only throw the mock failure into the main thread

Modified:
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java?rev=1045310&r1=1045309&r2=1045310&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestIndexWriterDelete.java Mon
Dec 13 19:05:23 2010
@@ -625,14 +625,20 @@ public class TestIndexWriterDelete exten
     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();



Mime
View raw message