From 4fa3884a2f9937e142dc9119b6d71119be1521b7 Mon Sep 17 00:00:00 2001 From: gaowenju Date: Wed, 21 Aug 2024 17:55:46 +0800 Subject: [PATCH] test: read timeout ok --- pkg/app/client/client_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/app/client/client_test.go b/pkg/app/client/client_test.go index b9bead69e..33334da29 100644 --- a/pkg/app/client/client_test.go +++ b/pkg/app/client/client_test.go @@ -455,7 +455,7 @@ func TestClientReadTimeout(t *testing.T) { }) engine.GET("/timeout", func(c context.Context, ctx *app.RequestContext) { time.Sleep(time.Second * 60) - ctx.String(consts.StatusOK, "ok") + ctx.String(consts.StatusOK, "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.Error("expected ErrTimeout got nil") + t.Errorf("expected ErrTimeout got nil, read resp body: %s", string(res.Body())) } else { if !strings.Contains(err.Error(), "timeout") { t.Errorf("expected ErrTimeout got %#v", err)