diff options
author | Russ Cox <rsc@golang.org> | 2022-07-29 00:32:14 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2022-08-02 17:23:42 +0000 |
commit | 1b7e71e8ae824c2ac661dd793bca29cf60378936 (patch) | |
tree | 4b3644cf090838362871a4458bc7397e2026b349 | |
parent | f2a9f3e2e0ce7e582d226ad9a41d3c36b146fc25 (diff) | |
download | go-1b7e71e8ae824c2ac661dd793bca29cf60378936.tar.gz go-1b7e71e8ae824c2ac661dd793bca29cf60378936.zip |
all: disable tests that fail on Alpine
These changes are enough to pass all.bash using the
disabled linux-amd64-alpine builder via debugnewvm.
For #19938.
For #39857.
Change-Id: I7d160612259c77764b70d429ad94f0864689cdce
Reviewed-on: https://go-review.googlesource.com/c/go/+/419995
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
-rw-r--r-- | misc/cgo/test/issue1435.go | 6 | ||||
-rw-r--r-- | misc/cgo/test/pkg_test.go | 4 | ||||
-rw-r--r-- | misc/cgo/testcarchive/carchive_test.go | 7 | ||||
-rw-r--r-- | misc/cgo/testcshared/cshared_test.go | 6 | ||||
-rw-r--r-- | src/syscall/syscall_linux_test.go | 3 |
5 files changed, 26 insertions, 0 deletions
diff --git a/misc/cgo/test/issue1435.go b/misc/cgo/test/issue1435.go index 91db155c90..3fb721ac39 100644 --- a/misc/cgo/test/issue1435.go +++ b/misc/cgo/test/issue1435.go @@ -10,6 +10,7 @@ package cgotest import ( "fmt" "os" + "runtime" "sort" "strings" "syscall" @@ -145,6 +146,11 @@ func test1435(t *testing.T) { if syscall.Getuid() != 0 { t.Skip("skipping root only test") } + if runtime.GOOS == "linux" { + if _, err := os.Stat("/etc/alpine-release"); err == nil { + t.Skip("skipping failing test on alpine - go.dev/issue/19938") + } + } // Launch some threads in C. const cts = 5 diff --git a/misc/cgo/test/pkg_test.go b/misc/cgo/test/pkg_test.go index 14013a4cd9..cbc80eee77 100644 --- a/misc/cgo/test/pkg_test.go +++ b/misc/cgo/test/pkg_test.go @@ -34,6 +34,10 @@ func TestCrossPackageTests(t *testing.T) { case "arm64": t.Skip("Can't exec cmd/go subprocess on iOS.") } + case "linux": + if _, err := os.Stat("/etc/alpine-release"); err == nil { + t.Skip("skipping failing test on alpine - go.dev/issue/39857") + } } GOPATH, err := os.MkdirTemp("", "cgotest") diff --git a/misc/cgo/testcarchive/carchive_test.go b/misc/cgo/testcarchive/carchive_test.go index c409c317dc..b959bc6cfa 100644 --- a/misc/cgo/testcarchive/carchive_test.go +++ b/misc/cgo/testcarchive/carchive_test.go @@ -46,6 +46,13 @@ func TestMain(m *testing.M) { fmt.Printf("SKIP - short mode and $GO_BUILDER_NAME not set\n") os.Exit(0) } + if runtime.GOOS == "linux" { + if _, err := os.Stat("/etc/alpine-release"); err == nil { + fmt.Printf("SKIP - skipping failing test on alpine - go.dev/issue/19938\n") + os.Exit(0) + } + } + log.SetFlags(log.Lshortfile) os.Exit(testMain(m)) } diff --git a/misc/cgo/testcshared/cshared_test.go b/misc/cgo/testcshared/cshared_test.go index 7fbcff24dd..d6219dc292 100644 --- a/misc/cgo/testcshared/cshared_test.go +++ b/misc/cgo/testcshared/cshared_test.go @@ -44,6 +44,12 @@ func testMain(m *testing.M) int { fmt.Printf("SKIP - short mode and $GO_BUILDER_NAME not set\n") os.Exit(0) } + if runtime.GOOS == "linux" { + if _, err := os.Stat("/etc/alpine-release"); err == nil { + fmt.Printf("SKIP - skipping failing test on alpine - go.dev/issue/19938\n") + os.Exit(0) + } + } GOOS = goEnv("GOOS") GOARCH = goEnv("GOARCH") diff --git a/src/syscall/syscall_linux_test.go b/src/syscall/syscall_linux_test.go index 0444b64266..ff128b1a19 100644 --- a/src/syscall/syscall_linux_test.go +++ b/src/syscall/syscall_linux_test.go @@ -516,6 +516,9 @@ func TestSetuidEtc(t *testing.T) { if syscall.Getuid() != 0 { t.Skip("skipping root only test") } + if _, err := os.Stat("/etc/alpine-release"); err == nil { + t.Skip("skipping glibc test on alpine - go.dev/issue/19938") + } vs := []struct { call string fn func() error |