]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: make TestScript/test_fuzz_minimize_dirty_cov use less memory
authorRoland Shoemaker <roland@golang.org>
Fri, 6 May 2022 17:15:49 +0000 (10:15 -0700)
committerRoland Shoemaker <roland@golang.org>
Fri, 13 May 2022 15:23:38 +0000 (15:23 +0000)
The test doesn't need to be as aggressive, it _should_ still tickle
the right paths with high enough probability. This should
significantly reduce the memory it consumes, which is at a premium
when testing fuzzing things.

Fixes #52744

Change-Id: I4d8dd5b29e65fb429962850b3f4477982452c856
Reviewed-on: https://go-review.googlesource.com/c/go/+/404634
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>

src/cmd/go/testdata/script/test_fuzz_minimize_dirty_cov.txt

index 571bf752d000e24e0752549fe8b7792c6cfa3ccf..1279f6e9ac02c7f21cd96244afb13701684fe3e9 100644 (file)
@@ -10,8 +10,8 @@
 [!fuzz-instrumented] skip
 
 env GOCACHE=$WORK/gocache
-go test -fuzz=FuzzCovMin -fuzztime=25s -test.fuzzcachedir=$GOCACHE/fuzz
-go run check_file/main.go $GOCACHE/fuzz/FuzzCovMin abcd
+go test -fuzz=FuzzCovMin -fuzztime=500000x -test.fuzzcachedir=$GOCACHE/fuzz
+go run check_file/main.go $GOCACHE/fuzz/FuzzCovMin ab
 
 -- go.mod --
 module test
@@ -22,8 +22,9 @@ package covmin
 import "testing"
 
 func FuzzCovMin(f *testing.F) {
+       f.Add([]byte("aa"))
        f.Fuzz(func(t *testing.T, data []byte) {
-               if len(data) >= 4 && data[0] == 'a' && data[1] == 'b' && data[2] == 'c' && data[3] == 'd' {
+               if len(data) == 2 && data[0] == 'a' && data[1] == 'b' {
                        return
                }
        })