@@ -13,6 +13,7 @@ import (
1313 "github.com/gin-gonic/gin"
1414 "github.com/stretchr/testify/assert"
1515 "github.com/stretchr/testify/require"
16+ commonutils "opencsg.com/csghub-server/common/utils/common"
1617)
1718
1819// captureLog is a helper that installs a slog JSON handler writing to a buffer
@@ -82,7 +83,7 @@ func TestLog_ClientCancelBeforeHandler(t *testing.T) {
8283
8384 logs := readLogs ()
8485 require .Len (t , logs , 1 , "must emit a log even when client canceled" )
85- assert .Equal (t , float64 (StatusClientClosedRequest ), logs [0 ]["status" ], "status should be 499 for client cancel" )
86+ assert .Equal (t , float64 (commonutils . StatusClientClosedRequest ), logs [0 ]["status" ], "status should be 499 for client cancel" )
8687 assert .Equal (t , "/test" , logs [0 ]["url" ])
8788}
8889
@@ -116,7 +117,7 @@ func TestLog_ClientCancelDuringSlowHandler(t *testing.T) {
116117
117118 logs := readLogs ()
118119 require .Len (t , logs , 1 , "must emit a log when client cancels during slow handler" )
119- assert .Equal (t , float64 (StatusClientClosedRequest ), logs [0 ]["status" ], "status should be 499" )
120+ assert .Equal (t , float64 (commonutils . StatusClientClosedRequest ), logs [0 ]["status" ], "status should be 499" )
120121}
121122
122123func TestLog_HandlerPanicWithRecovery (t * testing.T ) {
0 commit comments