From 90177e12780bf3410828980750d07cac75fca8c5 Mon Sep 17 00:00:00 2001 From: gaowenju Date: Wed, 21 Aug 2024 19:21:17 +0800 Subject: [PATCH] test: debug --- pkg/app/client/client_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/app/client/client_test.go b/pkg/app/client/client_test.go index 33334da29..ed5959bea 100644 --- a/pkg/app/client/client_test.go +++ b/pkg/app/client/client_test.go @@ -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() { @@ -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)