[ 
https://issues.apache.org/jira/browse/SOLR-11456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16201088#comment-16201088
 ] 

ASF subversion and git services commented on SOLR-11456:
--------------------------------------------------------

Commit 8c39b37c5ac7baa384fe9362924ce714edcb6f57 in lucene-solr's branch 
refs/heads/master from Chris Hostetter
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=8c39b37 ]

SOLR-11456: Fix HealthCheckHandlerTest's bogus asserts and timing/order related 
flakiness


> 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
>             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]

Reply via email to