From 69d6c7b8ee62b4db5a8f6399e15f27d47b209a29 Mon Sep 17 00:00:00 2001 From: qmuntal Date: Mon, 12 Feb 2024 11:04:24 +0100 Subject: [PATCH] net: skip TestModeSocket on older Windows versions 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 Reviewed-by: Dmitri Shuralyov Reviewed-by: Bryan Mills --- src/net/unixsock_windows_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/net/unixsock_windows_test.go b/src/net/unixsock_windows_test.go index b3e2260d587..1e54d6171a4 100644 --- a/src/net/unixsock_windows_test.go +++ b/src/net/unixsock_windows_test.go @@ -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)