Skip to content

Commit

Permalink
Update xhttp ErrAbortRetry
Browse files Browse the repository at this point in the history
  • Loading branch information
onanying committed Jan 12, 2024
1 parent b211769 commit 4881d36
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xhttp/request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ func TestRequestError(t *testing.T) {
func TestDebugAndRetry(t *testing.T) {
a := assert.New(t)

count := 0
xhttp.DefaultOptions.DebugFunc = func(l *xhttp.Log) {
log.Printf("%+v %+v %+v %+v\n", l.Duration, l.Request, l.Response, l.Error)
count++
}

url := "https://aaaaa.com/"
Expand All @@ -62,6 +64,7 @@ func TestDebugAndRetry(t *testing.T) {
a.Nil(resp)
a.NotNil(err)
a.Contains(err.Error(), "attempts fail")
a.Equal(count, 2)
}

func TestDebugAndAbortRetry(t *testing.T) {
Expand Down

0 comments on commit 4881d36

Please sign in to comment.