]> Cypherpunks repositories - gostls13.git/commitdiff
net: skip TestModeSocket on older Windows versions
authorqmuntal <quimmuntal@gmail.com>
Mon, 12 Feb 2024 10:04:24 +0000 (11:04 +0100)
committerQuim Muntal <quimmuntal@gmail.com>
Wed, 14 Feb 2024 06:40:17 +0000 (06:40 +0000)
CL 561937 taught os.Stat about IO_REPARSE_TAG_AF_UNIX and added a
test for it, TestModeSocket. This test fails on Windows older than
10.0.17063, in which AF_UNIX support was added. Skip the test on those
versions.

Some CI builders use Windows 10.0.14393, so CL 561937 broke them,
e.g. https://build.golang.org/log/5ea4f6422779f32eccfef3a25df54283ddd4e65e.

Change-Id: I6c21a78a1454d2d88321478288c0da1b8a93e590
Reviewed-on: https://go-review.googlesource.com/c/go/+/563256
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
src/net/unixsock_windows_test.go

index b3e2260d587b01f1b5ff9b4a7e8b8c7b93c29550..1e54d6171a41ce9fe90b32b4c208298f47088889 100644 (file)
@@ -33,7 +33,9 @@ func isBuild17063() bool {
        return ver >= 17063
 }
 
-func TestUnixConnLocalWindows(t *testing.T) {
+func skipIfUnixSocketNotSupported(t *testing.T) {
+       // TODO: the isBuild17063 check should be enough, investigate why 386 and arm
+       // can't run these tests on newer Windows.
        switch runtime.GOARCH {
        case "386":
                t.Skip("not supported on windows/386, see golang.org/issue/27943")
@@ -43,7 +45,10 @@ func TestUnixConnLocalWindows(t *testing.T) {
        if !isBuild17063() {
                t.Skip("unix test")
        }
+}
 
+func TestUnixConnLocalWindows(t *testing.T) {
+       skipIfUnixSocketNotSupported(t)
        handler := func(ls *localServer, ln Listener) {}
        for _, laddr := range []string{"", testUnixAddr(t)} {
                laddr := laddr
@@ -97,6 +102,7 @@ func TestUnixConnLocalWindows(t *testing.T) {
 }
 
 func TestModeSocket(t *testing.T) {
+       skipIfUnixSocketNotSupported(t)
        addr := testUnixAddr(t)
 
        l, err := Listen("unix", addr)