mirror of https://github.com/apache/lucene.git
fix (again) TestIW.testThreadInterruptDeadlock to properly close (abort) its writer
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@980428 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
747a1c2d8f
commit
b0e7f1c661
|
@ -4387,13 +4387,15 @@ public class TestIndexWriter extends LuceneTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
try {
|
||||
w.rollback();
|
||||
} catch (IOException ioe) {
|
||||
throw new RuntimeException(ioe);
|
||||
}
|
||||
|
||||
if (!failed) {
|
||||
// clear interrupt state:
|
||||
Thread.interrupted();
|
||||
try {
|
||||
w.rollback();
|
||||
} catch (IOException ioe) {
|
||||
throw new RuntimeException(ioe);
|
||||
}
|
||||
|
||||
try {
|
||||
_TestUtil.checkIndex(dir);
|
||||
} catch (Exception e) {
|
||||
|
@ -4618,9 +4620,9 @@ public class TestIndexWriter extends LuceneTestCase {
|
|||
for(int i=0;i<NUM_THREADS;i++) {
|
||||
threads[i].join();
|
||||
}
|
||||
assertFalse(failed.get());
|
||||
w.close();
|
||||
dir.close();
|
||||
assertFalse(failed.get());
|
||||
}
|
||||
|
||||
// both start & end are inclusive
|
||||
|
|
Loading…
Reference in New Issue