Skip to content

Commit

Permalink
test: read timeout ok
Browse files Browse the repository at this point in the history
  • Loading branch information
welkeyever committed Aug 21, 2024
1 parent df5ed5b commit 4fa3884
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/app/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
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.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)
Expand Down

0 comments on commit 4fa3884

Please sign in to comment.