mirror of https://github.com/apache/lucene.git
test bug
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1590231 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0dea18dd2e
commit
11708046b2
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue