diff options
author | Brad Fitzpatrick <bradfitz@golang.org> | 2016-09-14 18:14:34 +0000 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2016-09-14 19:06:32 +0000 |
commit | 983e2fd4e6fecd78789384069c476eead4806d1b (patch) | |
tree | 1c74a56356e25e517c33f821c27cba175bc94d63 /src/sort | |
parent | 83676b93fb9591fb452612b55237ffdeb2a59119 (diff) | |
download | go-983e2fd4e6fecd78789384069c476eead4806d1b.tar.gz go-983e2fd4e6fecd78789384069c476eead4806d1b.zip |
sort: cut 140 seconds off race build tests
No coverage is gained by running the 1e6 versions of the test over the
1e4 versions. It just adds 140 seconds of race overhead time.
Updates #17104
Change-Id: I41408aedae34a8b1a148eebdda20269cdefffba3
Reviewed-on: https://go-review.googlesource.com/29159
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Diffstat (limited to 'src/sort')
-rw-r--r-- | src/sort/sort_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sort/sort_test.go b/src/sort/sort_test.go index 60fac2d695..10a2c19684 100644 --- a/src/sort/sort_test.go +++ b/src/sort/sort_test.go @@ -6,10 +6,12 @@ package sort_test import ( "fmt" + "internal/testenv" "math" "math/rand" . "sort" "strconv" + stringspkg "strings" "testing" ) @@ -555,6 +557,9 @@ func TestCountStableOps(t *testing.T) { countOps(t, Stable, "Stable") } func TestCountSortOps(t *testing.T) { countOps(t, Sort, "Sort ") } func bench(b *testing.B, size int, algo func(Interface), name string) { + if stringspkg.HasSuffix(testenv.Builder(), "-race") && size > 1e4 { + b.Skip("skipping slow benchmark on race builder") + } b.StopTimer() data := make(intPairs, size) x := ^uint32(0) |