From: Cuong Manh Le Date: Mon, 27 Feb 2023 04:23:03 +0000 (+0700) Subject: os: checking for testable network before creating local listener X-Git-Tag: go1.21rc1~1473 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0d52401e2380125615d4a77df31498ce7fbd3b7f;p=gostls13.git os: checking for testable network before creating local listener Fixes #58745 Change-Id: Id6666477b2c25f081d6f86047cea12bf8b3cb679 Reviewed-on: https://go-review.googlesource.com/c/go/+/471495 Run-TryBot: Cuong Manh Le Reviewed-by: Than McIntosh Reviewed-by: Ian Lance Taylor Auto-Submit: Cuong Manh Le TryBot-Result: Gopher Robot Reviewed-by: Andy Pan --- diff --git a/src/os/readfrom_linux_test.go b/src/os/readfrom_linux_test.go index 3909c2f02e..c499071340 100644 --- a/src/os/readfrom_linux_test.go +++ b/src/os/readfrom_linux_test.go @@ -13,6 +13,7 @@ import ( "os" . "os" "path/filepath" + "runtime" "strconv" "strings" "syscall" @@ -701,6 +702,9 @@ func testGetPollFromReader(t *testing.T, proto string) { func createSocketPair(t *testing.T, proto string) (client, server net.Conn) { t.Helper() + if !nettest.TestableNetwork(proto) { + t.Skipf("%s does not support %q", runtime.GOOS, proto) + } ln, err := nettest.NewLocalListener(proto) if err != nil {