git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1590231 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2014-04-26 12:48:48 +00:00
parent 0dea18dd2e
commit 11708046b2
1 changed files with 5 additions and 2 deletions

View File

@ -546,14 +546,17 @@ public class TestIndexWriterExceptions extends LuceneTestCase {
if (doFail) {
StackTraceElement[] trace = new Exception().getStackTrace();
boolean sawFlush = false;
boolean sawFinishDocument = false;
for (int i = 0; i < trace.length; i++) {
if ("flush".equals(trace[i].getMethodName())) {
sawFlush = true;
break;
}
if ("finishDocument".equals(trace[i].getMethodName())) {
sawFinishDocument = true;
}
}
if (sawFlush && count++ >= 30) {
if (sawFlush && sawFinishDocument == false && count++ >= 30) {
doFail = false;
throw new IOException("now failing during flush");
}