From: Keith Randall Date: Thu, 17 Oct 2019 19:31:53 +0000 (-0700) Subject: regexp: skip long-running benchmarks if -short is specified X-Git-Tag: go1.14beta1~711 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9b8079158488120a0586d79ec57e0505fe0ec3eb;p=gostls13.git regexp: skip long-running benchmarks if -short is specified This CL helps race.bash finish in a reasonable amount of time. Otherwise the Match/Hard1/32M benchmark takes over 1200 seconds to finish on arm64, triggering a timeout. With this change the regexp benchmarks as a whole take only about a minute. Change-Id: Ie2260ef9f5709e32a74bd76f135bc384b2d9853f Reviewed-on: https://go-review.googlesource.com/c/go/+/201742 Run-TryBot: Keith Randall Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/regexp/exec_test.go b/src/regexp/exec_test.go index 1e8795525d..1f9a7a96e0 100644 --- a/src/regexp/exec_test.go +++ b/src/regexp/exec_test.go @@ -665,7 +665,7 @@ func BenchmarkMatch(b *testing.B) { for _, data := range benchData { r := MustCompile(data.re) for _, size := range benchSizes { - if isRaceBuilder && size.n > 1<<10 { + if (isRaceBuilder || testing.Short()) && size.n > 1<<10 { continue } t := makeText(size.n) @@ -688,7 +688,7 @@ func BenchmarkMatch_onepass_regex(b *testing.B) { b.Fatalf("want onepass regex, but %q is not onepass", r) } for _, size := range benchSizes { - if isRaceBuilder && size.n > 1<<10 { + if (isRaceBuilder || testing.Short()) && size.n > 1<<10 { continue } t := makeText(size.n)