This still isnt quite right though, because now that we trip
exceptions during Codec's finishDocument (and this test uses
ConcurrentMergeScheduler explicitly!), its possible to have an
uncaught exception in another thread from the codec's
TermVectorsWriter finishDocument(): e.g.
http://fortyounce.servebeer.com/job/the%204547%20machine%20gun/848/console

(run the seed with -Dtests.dups=20 and it will repro).

Can we re-arrange the test better? Otherwise in its current form we
would have to add install/deinstall a uncaught exception handler just
for this case (or turn off CMS)

On Mon, Jan 14, 2013 at 5:29 PM,  <[email protected]> wrote:
> Author: mikemccand
> Date: Mon Jan 14 22:29:29 2013
> New Revision: 1433177
>
> URL: http://svn.apache.org/viewvc?rev=1433177&view=rev
> Log:
> fix test bug
>
> Modified:
>     
> lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java
>
> Modified: 
> lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java
> URL: 
> http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java?rev=1433177&r1=1433176&r2=1433177&view=diff
> ==============================================================================
> --- 
> lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java
>  (original)
> +++ 
> lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java
>  Mon Jan 14 22:29:29 2013
> @@ -354,16 +354,20 @@ public class TestIndexWriterWithThreads
>          StackTraceElement[] trace = new Exception().getStackTrace();
>          boolean sawAbortOrFlushDoc = false;
>          boolean sawClose = false;
> +        boolean sawMerge = false;
>          for (int i = 0; i < trace.length; i++) {
>            if ("abort".equals(trace[i].getMethodName()) ||
>                "finishDocument".equals(trace[i].getMethodName())) {
>              sawAbortOrFlushDoc = true;
>            }
> +          if ("merge".equals(trace[i])) {
> +            sawMerge = true;
> +          }
>            if ("close".equals(trace[i].getMethodName())) {
>              sawClose = true;
>            }
>          }
> -        if (sawAbortOrFlushDoc && !sawClose) {
> +        if (sawAbortOrFlushDoc && !sawClose && !sawMerge) {
>            if (onlyOnce)
>              doFail = false;
>            //System.out.println(Thread.currentThread().getName() + ": now 
> fail");
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to