From dc2daeaa4e99dff4dae9c015fff2a58fa3cb670c Mon Sep 17 00:00:00 2001 From: Tommy Reilly Date: Wed, 28 Sep 2022 18:26:10 +0000 Subject: [PATCH] sql/covering: make OverlapCoveringMerge benchmark deterministic 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 --- pkg/sql/covering/BUILD.bazel | 1 - pkg/sql/covering/bench_test.go | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/sql/covering/BUILD.bazel b/pkg/sql/covering/BUILD.bazel index 2efa2f2ba1f3..9b5434ca2eda 100644 --- a/pkg/sql/covering/BUILD.bazel +++ b/pkg/sql/covering/BUILD.bazel @@ -20,7 +20,6 @@ go_test( embed = [":covering"], deps = [ "//pkg/util/leaktest", - "//pkg/util/timeutil", "@com_github_stretchr_testify//require", ], ) diff --git a/pkg/sql/covering/bench_test.go b/pkg/sql/covering/bench_test.go index c1fb0d463394..be2d01c08dc4 100644 --- a/pkg/sql/covering/bench_test.go +++ b/pkg/sql/covering/bench_test.go @@ -16,7 +16,6 @@ import ( "math/rand" "testing" - "github.com/cockroachdb/cockroach/pkg/util/timeutil" "github.com/stretchr/testify/require" ) @@ -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