if test fails, print zk layout

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1236037 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-01-26 03:58:52 +00:00
parent 11396fff5b
commit 19f8d0f623
1 changed files with 6 additions and 1 deletions

View File

@ -102,6 +102,7 @@ public class ZkControllerTest extends SolrTestCaseJ4 {
ZkTestServer server = new ZkTestServer(zkDir);
ZkController zkController = null;
boolean testFinished = false;
try {
server.run();
@ -127,8 +128,12 @@ public class ZkControllerTest extends SolrTestCaseJ4 {
if (DEBUG) {
zkController.printLayoutToStdOut();
}
testFinished = true;
} finally {
if (testFinished) {
zkController.getZkClient().printLayoutToStdOut();
}
if (zkController != null) {
zkController.close();
}