Skip to content

Commit

Permalink
test: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
welkeyever committed Aug 21, 2024
1 parent 4fa3884 commit 90177e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/app/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,11 @@ func TestClientReadTimeout(t *testing.T) {
engine := route.NewEngine(opt)

engine.GET("/normal", func(c context.Context, ctx *app.RequestContext) {
ctx.String(consts.StatusOK, "ok")
ctx.String(201, "ok")
})
engine.GET("/timeout", func(c context.Context, ctx *app.RequestContext) {
time.Sleep(time.Second * 60)
ctx.String(consts.StatusOK, "timeout ok")
ctx.String(202, "timeout ok")
})
go engine.Run()
defer func() {
Expand Down Expand Up @@ -499,7 +499,7 @@ func TestClientReadTimeout(t *testing.T) {

if err := c.Do(context.Background(), req, res); !errors.Is(err, errs.ErrTimeout) {
if err == nil {
t.Errorf("expected ErrTimeout got nil, read resp body: %s", string(res.Body()))
t.Errorf("expected ErrTimeout got nil, req url: %s, read resp body: %s, status: %d", string(req.URI().FullURI()), string(res.Body()), res.StatusCode())
} else {
if !strings.Contains(err.Error(), "timeout") {
t.Errorf("expected ErrTimeout got %#v", err)
Expand Down

0 comments on commit 90177e1

Please sign in to comment.