print zk contents when failing to get leader url

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1292243 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sami Siren 2012-02-22 11:35:08 +00:00
parent 9e1e2d40a4
commit 307cf98e1f
1 changed files with 3 additions and 1 deletions

View File

@ -161,7 +161,7 @@ public class LeaderElectionTest extends SolrTestCaseJ4 {
private String getLeaderUrl(final String collection, final String slice)
throws KeeperException, InterruptedException {
int iterCount = 60;
while (iterCount-- > 0)
while (iterCount-- > 0) {
try {
byte[] data = zkClient.getData(
ZkStateReader.getShardLeadersPath(collection, slice), null, null,
@ -172,6 +172,8 @@ public class LeaderElectionTest extends SolrTestCaseJ4 {
} catch (NoNodeException e) {
Thread.sleep(500);
}
}
zkClient.printLayoutToStdOut();
throw new RuntimeException("Could not get leader props");
}