mirror of https://github.com/apache/lucene.git
assert the IOE is correctcheck
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1529650 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cffeb29a10
commit
f514b787e6
|
@ -1218,6 +1218,9 @@ public class TestIndexWriterDelete extends LuceneTestCase {
|
|||
d.close();
|
||||
}
|
||||
|
||||
private static class FakeIOException extends IOException {
|
||||
}
|
||||
|
||||
// Make sure if we hit disk full, and then later disk
|
||||
// frees up, and we successfully close IW or open an NRT
|
||||
// reader, we don't lose any deletes:
|
||||
|
@ -1232,8 +1235,6 @@ public class TestIndexWriterDelete extends LuceneTestCase {
|
|||
final AtomicBoolean shouldFail = new AtomicBoolean();
|
||||
dir.failOn(new MockDirectoryWrapper.Failure() {
|
||||
|
||||
boolean failedAlready;
|
||||
|
||||
@Override
|
||||
public void eval(MockDirectoryWrapper dir) throws IOException {
|
||||
StackTraceElement[] trace = new Exception().getStackTrace();
|
||||
|
@ -1249,7 +1250,7 @@ public class TestIndexWriterDelete extends LuceneTestCase {
|
|||
new Throwable().printStackTrace(System.out);
|
||||
}
|
||||
shouldFail.set(false);
|
||||
throw new IOException("now fail on purpose");
|
||||
throw new FakeIOException();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
@ -1292,7 +1293,7 @@ public class TestIndexWriterDelete extends LuceneTestCase {
|
|||
}
|
||||
|
||||
w.close();
|
||||
} catch (IOException ioe) {
|
||||
} catch (FakeIOException ioe) {
|
||||
// expected
|
||||
if (VERBOSE) {
|
||||
System.out.println("TEST: w.close() hit expected IOE");
|
||||
|
|
Loading…
Reference in New Issue