[
https://issues.apache.org/jira/browse/SOLR-11456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hoss Man resolved SOLR-11456.
-----------------------------
Resolution: Fixed
Assignee: Hoss Man
Fix Version/s: master (8.0)
> HealthCheckHandlerTest.testHealthCheckHandler() asserts nothing useful
> ----------------------------------------------------------------------
>
> Key: SOLR-11456
> URL: https://issues.apache.org/jira/browse/SOLR-11456
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Reporter: Hoss Man
> Assignee: Hoss Man
> Fix For: master (8.0)
>
> Attachments: SOLR-11456.patch, SOLR-11456.patch
>
>
> The meat of {{HealthCheckHandlerTest.testHealthCheckHandler()}} currently
> looks like this...
> {code}
> while (live_nodes.size() == 1 && counter++ < 100) {
> Thread.sleep(100);
> live_nodes =
> cluster.getSolrClient().getZkStateReader().getClusterState().getLiveNodes();
> }
> try {
> req.process(httpSolrClient);
> } catch (HttpSolrClient.RemoteSolrException e) {
> assertTrue(e.getMessage(), e.getMessage().contains("Host
> Unavailable"));
> assertEquals(SolrException.ErrorCode.SERVICE_UNAVAILABLE.code,
> e.code());
> }
> {code}
> * nothing actually asserts that {{live_nodes.size() != 1}} -- so the loop
> could just exit after 100 iterations w/o any changes to hte system happening.
> * instead of using expectThrows, the only assertions are inside the catch
> block -- if the code (unexpectedly) succeeds the test will not fail (false
> positive)
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]