mirror of https://github.com/apache/lucene.git
SOLR-12388: Add an expected exception message to SearchHandlerTest.testRequireZkConnectedDistrib()
This commit is contained in:
parent
ce8735556d
commit
252a8145d9
|
@ -241,16 +241,21 @@ public class SearchHandlerTest extends SolrTestCaseJ4
|
||||||
Replica connectedReplica = connectedSlice.getReplicas().iterator().next();
|
Replica connectedReplica = connectedSlice.getReplicas().iterator().next();
|
||||||
try (HttpSolrClient httpSolrClient = new HttpSolrClient.Builder(connectedReplica.getCoreUrl()).build()) {
|
try (HttpSolrClient httpSolrClient = new HttpSolrClient.Builder(connectedReplica.getCoreUrl()).build()) {
|
||||||
ignoreException("ZooKeeper is not connected");
|
ignoreException("ZooKeeper is not connected");
|
||||||
|
ignoreException("no servers hosting shard:");
|
||||||
JettySolrRunner disconnectedJetty = miniCluster.getReplicaJetty(disconnectedReplica);
|
JettySolrRunner disconnectedJetty = miniCluster.getReplicaJetty(disconnectedReplica);
|
||||||
disconnectedJetty.getCoreContainer().getZkController().getZkClient().close();
|
disconnectedJetty.getCoreContainer().getZkController().getZkClient().close();
|
||||||
req.process(httpSolrClient);
|
req.process(httpSolrClient);
|
||||||
fail("An exception should be thrown when ZooKeeper is not connected and shards.tolerant=requireZkConnected");
|
fail("An exception should be thrown when ZooKeeper is not connected and shards.tolerant=requireZkConnected");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
assertTrue("Exception message is missing 'no servers hosting shard:': " + e, e.getMessage().contains("no servers hosting shard:"));
|
assertTrue("Unrecognized exception message: " + e,
|
||||||
|
e.getMessage().contains("no servers hosting shard:")
|
||||||
|
|| e.getMessage().contains("ZooKeeper is not connected"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
miniCluster.shutdown();
|
miniCluster.shutdown();
|
||||||
|
unIgnoreException("no servers hosting shard:");
|
||||||
|
unIgnoreException("ZooKeeper is not connected");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue