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 <0intro@gmail.com>
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
diff --git a/http2/transport_test.go b/http2/transport_test.go
index 23b4989..ec7493c 100644
--- a/http2/transport_test.go
+++ b/http2/transport_test.go
@@ -3385,6 +3385,10 @@
ct.client = func() error {
defer ct.cc.(*net.TCPConn).CloseWrite()
+ if runtime.GOOS == "plan9" {
+ // CloseWrite not supported on Plan 9; Issue 17906
+ defer ct.cc.(*net.TCPConn).Close()
+ }
defer close(clientDone)
req, _ := http.NewRequest("GET", "https://dummy.tld/", nil)
res, err := ct.tr.RoundTrip(req)