mirror of https://github.com/apache/lucene.git
test: list index files on failure
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1622693 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ff9e0437de
commit
426a5736d9
|
@ -1166,6 +1166,7 @@ public class TestIndexWriter extends LuceneTestCase {
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
log.println("thread " + id + " FAILED; unexpected exception");
|
log.println("thread " + id + " FAILED; unexpected exception");
|
||||||
t.printStackTrace(log);
|
t.printStackTrace(log);
|
||||||
|
listIndexFiles(log, dir);
|
||||||
failed = true;
|
failed = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1194,6 +1195,7 @@ public class TestIndexWriter extends LuceneTestCase {
|
||||||
failed = true;
|
failed = true;
|
||||||
log.println("thread " + id + ": CheckIndex FAILED: unexpected exception");
|
log.println("thread " + id + ": CheckIndex FAILED: unexpected exception");
|
||||||
e.printStackTrace(log);
|
e.printStackTrace(log);
|
||||||
|
listIndexFiles(log, dir);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
IndexReader r = DirectoryReader.open(dir);
|
IndexReader r = DirectoryReader.open(dir);
|
||||||
|
@ -1203,6 +1205,7 @@ public class TestIndexWriter extends LuceneTestCase {
|
||||||
failed = true;
|
failed = true;
|
||||||
log.println("thread " + id + ": DirectoryReader.open FAILED: unexpected exception");
|
log.println("thread " + id + ": DirectoryReader.open FAILED: unexpected exception");
|
||||||
e.printStackTrace(log);
|
e.printStackTrace(log);
|
||||||
|
listIndexFiles(log, dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -1218,6 +1221,16 @@ public class TestIndexWriter extends LuceneTestCase {
|
||||||
throw new RuntimeException("thread " + id, e);
|
throw new RuntimeException("thread " + id, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void listIndexFiles(PrintStream log, Directory dir) {
|
||||||
|
try {
|
||||||
|
log.println("index files: " + Arrays.toString(dir.listAll()));
|
||||||
|
} catch (IOException ioe) {
|
||||||
|
// Suppress
|
||||||
|
log.println("failed to index files:");
|
||||||
|
ioe.printStackTrace(log);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testThreadInterruptDeadlock() throws Exception {
|
public void testThreadInterruptDeadlock() throws Exception {
|
||||||
|
@ -1730,7 +1743,6 @@ public class TestIndexWriter extends LuceneTestCase {
|
||||||
Arrays.fill(chars, 'x');
|
Arrays.fill(chars, 'x');
|
||||||
Document doc = new Document();
|
Document doc = new Document();
|
||||||
final String bigTerm = new String(chars);
|
final String bigTerm = new String(chars);
|
||||||
final BytesRef bigTermBytesRef = new BytesRef(bigTerm);
|
|
||||||
|
|
||||||
// This contents produces a too-long term:
|
// This contents produces a too-long term:
|
||||||
String contents = "abc xyz x" + bigTerm + " another term";
|
String contents = "abc xyz x" + bigTerm + " another term";
|
||||||
|
|
Loading…
Reference in New Issue