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:
Michael McCandless 2010-07-29 12:56:52 +00:00
parent 747a1c2d8f
commit b0e7f1c661
1 changed files with 9 additions and 7 deletions

View File

@ -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