mirror of
https://github.com/golang/go
synced 2024-11-07 16:26:11 -07:00
net/http: remove five second timeout from TestTransportClosesBodyOnError
Wait forever and let the test time out with a stack trace if the expected response doesn't happen. Fixes #57990 Change-Id: I835def63db113752cdd06e03e258cb10d63a6a25 Reviewed-on: https://go-review.googlesource.com/c/go/+/463222 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
This commit is contained in:
parent
d49719b1f7
commit
7e5906a57d
@ -3700,13 +3700,8 @@ func testTransportClosesBodyOnError(t *testing.T, mode testMode) {
|
||||
if err == nil || !strings.Contains(err.Error(), fakeErr.Error()) {
|
||||
t.Fatalf("Do error = %v; want something containing %q", err, fakeErr.Error())
|
||||
}
|
||||
select {
|
||||
case err := <-readBody:
|
||||
if err == nil {
|
||||
t.Errorf("Unexpected success reading request body from handler; want 'unexpected EOF reading trailer'")
|
||||
}
|
||||
case <-time.After(5 * time.Second):
|
||||
t.Error("timeout waiting for server handler to complete")
|
||||
if err := <-readBody; err == nil {
|
||||
t.Errorf("Unexpected success reading request body from handler; want 'unexpected EOF reading trailer'")
|
||||
}
|
||||
select {
|
||||
case <-didClose:
|
||||
|
Loading…
Reference in New Issue
Block a user