janhoy opened a new pull request, #4703:
URL: https://github.com/apache/solr/pull/4703

   Follow-up to #4702, from the same test-suite review.
   
   `NodeHealthSolrCloudTest` had two failure-scenario tests that each booted an 
**extra Jetty node** just to break its ZK connection — while the code under 
test (`NodeHealth.getClusterState()` and the cloud-mode health checks) only 
reads state reachable through `CoreContainer` and is trivially mockable.
   
   This PR:
   
   * Adds **`NodeHealthTest`** — a plain `SolrTestCase` with Mockito (no 
Jetty/ZK, runs in milliseconds), following the existing pattern of 
`GetNodeCommandStatusTest` in the same package. It mocks the `CoreContainer → 
ZkController → ZkStateReader → SolrZkClient` chain and covers:
     * null / shut-down `CoreContainer` → 500 *(previously untested)*
     * healthy node → OK
     * ZK client closed, and ZK client disconnected → 503 "Not connected to zk"
     * node missing from live nodes → 503 "Not in live nodes"
     * `requireHealthyCores` with core loading incomplete → 503 *(previously 
untested)*
     * `requireHealthyCores` with all cores healthy → OK
     * a recovering core → 503 with unhealthy-replica count (reusing 
`ClusterStateMockUtil`)
   * Slims down **`NodeHealthSolrCloudTest`** by removing the two extra-Jetty 
failure tests (now covered by the mocks), keeping the happy-path tests that 
exercise the real HTTP/Jersey wiring on the shared 1-node cluster.
   
   Test-only change, no changelog entry.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to