Skip to content

Commit 056145c

Browse files
committed
net/http: deflake TestTransportRetryAfterGOAWAY
Drop a redundant Close of a net.Conn. On Windows, writing to a closed connection will cause future reads from the connection to fail, even if there is buffered data available. When the test server writes a GOAWAY frame and immediately closes the connection, this can result in the client never seeing the GOAWAY. To avoid this, don't close server connections until after all test functions have returned. Fixes golang/go#59919 Change-Id: I82ed15870f3e6cd47f833a7a60b007b2fa2e15b0 Reviewed-on: https://go-review.googlesource.com/c/net/+/496056 TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Damien Neil <[email protected]> Reviewed-by: Bryan Mills <[email protected]>
1 parent abee42a commit 056145c

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

http2/transport_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3783,7 +3783,6 @@ func testClientMultipleDials(t *testing.T, client func(*Transport), server func(
37833783
go func(count int) {
37843784
defer wg.Done()
37853785
server(count, ct)
3786-
sc.Close()
37873786
}(count)
37883787
return cc, nil
37893788
}

0 commit comments

Comments
 (0)