ryankert01 commented on code in PR #970:
URL: https://github.com/apache/yunikorn-core/pull/970#discussion_r1764388648


##########
pkg/webservice/handlers_test.go:
##########
@@ -318,6 +318,18 @@ func newApplication(appID, partitionName, queueName, rmID 
string, ugi security.U
        return objects.NewApplication(siApp, userGroup, nil, rmID)
 }
 
+func TestGetStackInfo(t *testing.T) {
+       req, err := http.NewRequest("GET", "", strings.NewReader(baseConf))
+       assert.NilError(t, err, "Error creating request")
+       resp := &MockResponseWriter{}
+       getStackInfo(resp, req)
+
+       // assert stack trace
+       assert.Assert(t, strings.Contains(string(resp.outputBytes), 
"goroutine"), "Stack trace should be present in the response")
+       assert.Assert(t, strings.Contains(string(resp.outputBytes), "test"), 
"Stack trace should be present in the response")
+       assert.Assert(t, strings.Contains(string(resp.outputBytes), 
"github.com/apache/yunikorn-core/pkg/webservice.getStackInfo"), "Stack trace 
should be present in the response")
+}

Review Comment:
   @manirajv06 Just to clarify, I'm actually asking how to create a negative 
case (such as StatusInternalServerError). The whole API doesn't need any 
parameter, and the function mainly use `runtime.Stacktrace`, not sure if 
there's a way to fail it... 



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