]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo/internal/testsanitizers: make the libfuzzer tests all short
authorMichael Anthony Knyszek <mknyszek@google.com>
Thu, 30 May 2024 19:28:39 +0000 (19:28 +0000)
committerGopher Robot <gobot@golang.org>
Fri, 31 May 2024 00:12:03 +0000 (00:12 +0000)
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>

src/cmd/cgo/internal/testsanitizers/libfuzzer_test.go

index 9cb67e7a1d62654a6bcad7e5129291f5428c1b67..85c8f7bbfbeddadb4a1d05d45efa4491be629af0 100644 (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)