in phoenix-queryserver-load-balancer/src/it/java/org/apache/phoenix/end2end/LoadBalancerEnd2EndIT.java [112:134]
public void testNoPhoenixQueryServerNodeInZookeeper() throws Exception{
List<HostAndPort> hostAndPorts = Arrays.asList(pqs1, pqs2, pqs3);
for(HostAndPort pqs: hostAndPorts) {
String fullPathToNode = LOAD_BALANCER_CONFIGURATION.getFullPathToNode(pqs);
curatorFramework.delete().deletingChildrenIfNeeded().forPath(fullPathToNode);
while (curatorFramework.checkExists().forPath(fullPathToNode) != null){
//wait for the node to deleted
Thread.sleep(1000);
};
}
//delete the parent
curatorFramework.delete().forPath(path);
// should throw an exception as there is
// no node in the zookeeper
try {
loadBalancer.getSingleServiceLocation();
} catch(Exception e) {
throw e;
} finally {
// need to create node for other tests to run.
createNodeForTesting(hostAndPorts);
}
}