From 09e5bab8c1310aa1a9860c40c9e4babacffb13d8 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Thu, 30 May 2024 19:28:39 +0000 Subject: [PATCH] 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 Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Commit-Queue: Michael Knyszek --- .../cgo/internal/testsanitizers/libfuzzer_test.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/cmd/cgo/internal/testsanitizers/libfuzzer_test.go b/src/cmd/cgo/internal/testsanitizers/libfuzzer_test.go index 9cb67e7a1d..85c8f7bbfb 100644 --- a/src/cmd/cgo/internal/testsanitizers/libfuzzer_test.go +++ b/src/cmd/cgo/internal/testsanitizers/libfuzzer_test.go @@ -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) -- 2.48.1