Skip to content

Commit

Permalink
🩹 Fix: Update error from FailOnTimeout to os.ErrDeadlineExceeded in t…
Browse files Browse the repository at this point in the history
…ests
  • Loading branch information
grivera64 committed Nov 12, 2024
1 parent 1220df7 commit 498df60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"net"
"net/http"
"net/http/httptest"
"os"
"reflect"
"regexp"
"runtime"
Expand Down Expand Up @@ -1473,7 +1474,7 @@ func Test_App_Test_timeout(t *testing.T) {
Timeout: 100 * time.Millisecond,
FailOnTimeout: true,
})
require.Equal(t, errors.New("test: timeout error after 100ms"), err)
require.Equal(t, os.ErrDeadlineExceeded, err)
}

func Test_App_Test_timeout_empty_response(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion middleware/proxy/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io"
"net"
"net/http/httptest"
"os"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -655,7 +656,7 @@ func Test_Proxy_DoDeadline_PastDeadline(t *testing.T) {
Timeout: 1 * time.Second,
FailOnTimeout: true,
})
require.Equal(t, errors.New("test: timeout error after 1s"), err1)
require.Equal(t, os.ErrDeadlineExceeded, err1)
}

// go test -race -run Test_Proxy_Do_HTTP_Prefix_URL
Expand Down

0 comments on commit 498df60

Please sign in to comment.