aboutsummaryrefslogtreecommitdiff
path: root/client_test.go
diff options
context:
space:
mode:
authorGravatar Erik Dubbelboer <erik@dubbelboer.com> 2020-01-31 22:21:00 +0100
committerGravatar GitHub <noreply@github.com> 2020-01-31 22:21:00 +0100
commit69d5c3721a71f33ed6be8cc8bb5d8a476efedea8 (patch)
tree133e21c43d614d7b7e9e1683e69561d38c11f429 /client_test.go
parentFix XHR Typo (#735) (diff)
downloadfasthttp-69d5c3721a71f33ed6be8cc8bb5d8a476efedea8.tar.gz
fasthttp-69d5c3721a71f33ed6be8cc8bb5d8a476efedea8.tar.bz2
fasthttp-69d5c3721a71f33ed6be8cc8bb5d8a476efedea8.zip
Client should return ErrTimeout on timeout (#736)v1.9.0
Not ErrConnectionClosed which is incorrect. Fixes: https://github.com/valyala/fasthttp/issues/355
Diffstat (limited to 'client_test.go')
-rw-r--r--client_test.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/client_test.go b/client_test.go
index dca0046..841f1ee 100644
--- a/client_test.go
+++ b/client_test.go
@@ -436,7 +436,9 @@ func TestClientReadTimeout(t *testing.T) {
req.SetRequestURI("http://localhost")
req.SetConnectionClose()
- c.Do(req, res) //nolint:errcheck
+ if err := c.Do(req, res); err != ErrTimeout {
+ t.Errorf("expected ErrTimeout got %#v", err)
+ }
ReleaseRequest(req)
ReleaseResponse(res)