cmd/cgo/internal/testsanitizers: make the libfuzzer tests all short

CL 589295 only made one of the two tests short, because the other one
seemed to be passing consistently in short mode. On the builders, it
seems to still fail maybe 30% of the time by taking too long. Disable
these tests in short mode.

For #67698.

Change-Id: I9fd047f834f7493b608dd1fee5b9b6dfabbea03d
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-clang15,gotip-linux-386-clang15
Reviewed-on: https://go-review.googlesource.com/c/go/+/589495
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
Michael Anthony Knyszek 2024-05-30 19:28:39 +00:00 committed by Gopher Robot
parent 1ed8166192
commit 09e5bab8c1

View file

@ -13,8 +13,13 @@ import (
)
func TestLibFuzzer(t *testing.T) {
// Skip tests in short mode.
if testing.Short() {
t.Skip("libfuzzer tests can take upwards of minutes to run; skipping in short mode")
}
testenv.MustHaveGoBuild(t)
testenv.MustHaveCGO(t)
goos, err := goEnv("GOOS")
if err != nil {
t.Fatal(err)
@ -33,9 +38,8 @@ func TestLibFuzzer(t *testing.T) {
goSrc string
cSrc string
expectedError string
short bool
}{
{goSrc: "libfuzzer1.go", expectedError: "panic: found it", short: true},
{goSrc: "libfuzzer1.go", expectedError: "panic: found it"},
{goSrc: "libfuzzer2.go", cSrc: "libfuzzer2.c", expectedError: "panic: found it"},
}
for _, tc := range cases {
@ -44,11 +48,6 @@ func TestLibFuzzer(t *testing.T) {
t.Run(name, func(t *testing.T) {
t.Parallel()
// Skip long-running tests in short mode.
if testing.Short() && !tc.short {
t.Skipf("%s can take upwards of minutes to run; skipping in short mode", name)
}
dir := newTempDir(t)
defer dir.RemoveAll(t)