fix test bug

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1433177 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2013-01-14 22:29:29 +00:00
parent 9050df8046
commit a795b5ab17

View File

@ -354,16 +354,20 @@ public class TestIndexWriterWithThreads extends LuceneTestCase {
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");