Commit 2a668e24 authored by Sina Siadat's avatar Sina Siadat Committed by Brad Fitzpatrick

net/http: simplify ctx.Err() call in test

See CL 40291. ctx.Err() is defined to only return non-nil exactly
when ctx.Done() returns a closed channel.

Change-Id: I12f51d8c42228f759273319b3ccc28012cb9fc73
Reviewed-on: https://go-review.googlesource.com/71310
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent e49bc465
......@@ -686,13 +686,9 @@ func TestHTTP2WriteDeadlineExtendedOnNewRequest(t *testing.T) {
req = req.WithContext(ctx)
r, err := c.Do(req)
select {
case <-ctx.Done():
if ctx.Err() == context.DeadlineExceeded {
t.Fatalf("http2 Get #%d response timed out", i)
}
default:
}
if err != nil {
t.Fatalf("http2 Get #%d: %v", i, err)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment