Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kv/kvserver: disable the below-raft proto tracking in race builds #50239

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pkg/kv/kvserver/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/storage/enginepb"
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster"
"github.com/cockroachdb/cockroach/pkg/util"
"github.com/cockroachdb/cockroach/pkg/util/randutil"
)

Expand All @@ -40,6 +41,15 @@ func TestMain(m *testing.M) {
serverutils.InitTestServerFactory(server.TestServerFactory)
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)

// The below-Raft proto tracking is fairly expensive in terms of allocations
// which significantly impacts the tests under -race. We're already doing the
// below-Raft proto tracking in non-race builds, so there is little benefit
// to also doing it in race builds.
if util.RaceEnabled {
os.Exit(m.Run())
return
}

// Create a set of all protos we believe to be marshaled downstream of raft.
// After the tests are run, we'll subtract the encountered protos from this
// set.
Expand Down