Commit 983e2fd4 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

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: 's avatarJosh Bleecher Snyder <josharian@gmail.com>
parent 83676b93
...@@ -6,10 +6,12 @@ package sort_test ...@@ -6,10 +6,12 @@ package sort_test
import ( import (
"fmt" "fmt"
"internal/testenv"
"math" "math"
"math/rand" "math/rand"
. "sort" . "sort"
"strconv" "strconv"
stringspkg "strings"
"testing" "testing"
) )
...@@ -555,6 +557,9 @@ func TestCountStableOps(t *testing.T) { countOps(t, Stable, "Stable") } ...@@ -555,6 +557,9 @@ func TestCountStableOps(t *testing.T) { countOps(t, Stable, "Stable") }
func TestCountSortOps(t *testing.T) { countOps(t, Sort, "Sort ") } func TestCountSortOps(t *testing.T) { countOps(t, Sort, "Sort ") }
func bench(b *testing.B, size int, algo func(Interface), name string) { 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() b.StopTimer()
data := make(intPairs, size) data := make(intPairs, size)
x := ^uint32(0) x := ^uint32(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment