brandboat commented on code in PR #743:
URL: https://github.com/apache/yunikorn-core/pull/743#discussion_r1410580807


##########
pkg/webservice/handlers_test.go:
##########
@@ -1720,3 +1720,83 @@ func verifyStateDumpJSON(t *testing.T, aggregated 
*AggregatedStateInfo) {
        assert.Check(t, len(aggregated.Config.SchedulerConfig.Partitions) > 0)
        assert.Check(t, len(aggregated.Config.Extra) > 0)
 }
+
+func TestCheckHealthStatusNotFound(t *testing.T) {
+       NewWebApp(&scheduler.ClusterContext{}, nil)
+       req, err := http.NewRequest("GET", "/ws/v1/scheduler/healthcheck", 
strings.NewReader(""))
+       assert.NilError(t, err, "Error while creating the healthcheck request")
+       resp := &MockResponseWriter{}
+       checkHealthStatus(resp, req)
+
+       var errInfo dao.YAPIError
+       err = json.Unmarshal(resp.outputBytes, &errInfo)
+       assert.NilError(t, err, unmarshalError)
+       assert.Equal(t, http.StatusNotFound, errInfo.StatusCode, 
statusCodeError)
+       assert.Equal(t, "The healthy status of scheduler is not found", 
errInfo.Message, jsonMessageError)

Review Comment:
   Already addressed comments in the latest commit, many thanks !



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

Reply via email to