Skip to content

Commit 627f964

Browse files
Richard Miller0intro
Richard Miller
authored andcommitted
x/net/http2: don't rely on TCP CloseWrite in tests on Plan 9
In TestTransportPingWhenReading, a TCP half-close was being used, which isn't supported in the Plan 9 kernel. The workaround is to call (*TCPConn).Close when running on Plan 9. See golang/go#17906 Fixes golang/go#39233 Change-Id: Ifb2934621fb53d76a3b161b239c438c13f8c508e Reviewed-on: https://go-review.googlesource.com/c/net/+/235217 Reviewed-by: David du Colombier <[email protected]> Run-TryBot: David du Colombier <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 3c3fba1 commit 627f964

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

http2/transport_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3385,6 +3385,10 @@ func testTransportPingWhenReading(t *testing.T, readIdleTimeout, serverResponseI
33853385

33863386
ct.client = func() error {
33873387
defer ct.cc.(*net.TCPConn).CloseWrite()
3388+
if runtime.GOOS == "plan9" {
3389+
// CloseWrite not supported on Plan 9; Issue 17906
3390+
defer ct.cc.(*net.TCPConn).Close()
3391+
}
33883392
defer close(clientDone)
33893393
req, _ := http.NewRequest("GET", "https://dummy.tld/", nil)
33903394
res, err := ct.tr.RoundTrip(req)

0 commit comments

Comments
 (0)