Skip to content

Commit

Permalink
sql/covering: make OverlapCoveringMerge benchmark deterministic
Browse files Browse the repository at this point in the history
Previously we seeded RNG with time and benchmark results varied widely.
In order to make sure this doesn't make noise when comparing different
versions make the seed a constant.

Fixes: #88919

Release note: None
  • Loading branch information
cucaroach committed Oct 3, 2022
1 parent 0961abd commit dc2daea
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion pkg/sql/covering/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ go_test(
embed = [":covering"],
deps = [
"//pkg/util/leaktest",
"//pkg/util/timeutil",
"@com_github_stretchr_testify//require",
],
)
Expand Down
3 changes: 1 addition & 2 deletions pkg/sql/covering/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"math/rand"
"testing"

"github.com/cockroachdb/cockroach/pkg/util/timeutil"
"github.com/stretchr/testify/require"
)

Expand All @@ -25,7 +24,7 @@ func BenchmarkOverlapCoveringMerge(b *testing.B) {
name string
inputs []Covering
}
rand.Seed(timeutil.Now().Unix())
rand.Seed(0)

for _, numLayers := range []int{
1, // single backup
Expand Down

0 comments on commit dc2daea

Please sign in to comment.