fix test to catch any Throwable, not just IOExc, and then print the IW infoStream

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1700068 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2015-08-29 18:56:05 +00:00
parent 5b6f1390ba
commit 85b6c90b3a
1 changed files with 9 additions and 9 deletions

View File

@ -228,29 +228,29 @@ public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
// obtains, across IndexReader & // obtains, across IndexReader &
// IndexWriters should be "fair" (ie // IndexWriters should be "fair" (ie
// FIFO). // FIFO).
} catch (Exception e) { } catch (Throwable t) {
hitException = true; hitException = true;
System.out.println("Stress Test Index Writer: creation hit unexpected exception: " + e.toString()); System.out.println("Stress Test Index Writer: creation hit unexpected exception: " + t.toString());
e.printStackTrace(System.out); t.printStackTrace(System.out);
System.out.println(toString(baos)); System.out.println(toString(baos));
break; break;
} }
if (writer != null) { if (writer != null) {
try { try {
addDoc(writer); addDoc(writer);
} catch (IOException e) { } catch (Throwable t) {
hitException = true; hitException = true;
System.out.println("Stress Test Index Writer: addDoc hit unexpected exception: " + e.toString()); System.out.println("Stress Test Index Writer: addDoc hit unexpected exception: " + t.toString());
e.printStackTrace(System.out); t.printStackTrace(System.out);
System.out.println(toString(baos)); System.out.println(toString(baos));
break; break;
} }
try { try {
writer.close(); writer.close();
} catch (IOException e) { } catch (Throwable t) {
hitException = true; hitException = true;
System.out.println("Stress Test Index Writer: close hit unexpected exception: " + e.toString()); System.out.println("Stress Test Index Writer: close hit unexpected exception: " + t.toString());
e.printStackTrace(System.out); t.printStackTrace(System.out);
System.out.println(toString(baos)); System.out.println(toString(baos));
break; break;
} }