Skip to content

Commit aa92f9c

Browse files
craig[bot]Nukitt
andcommitted
159383: kvserver, drpc: randomly enable DRPC for tests r=suj-krishnan,cthumuluru-crdb a=Nukitt This change introduces a package-level setting that randomly enables drpc in the kvserver package. Note: Tests in `loqrecovery` currently fail, we are tracking them in cockroachdb#159372 and DRPC is disabled for them right now. Epic: CRDB-48935 Fixes: cockroachdb#155570 Release note: None Co-authored-by: Nukitt <nukit.tailor@cockroachlabs.com>
2 parents 4ec3fb2 + 690ea72 commit aa92f9c

File tree

10 files changed

+26
-10
lines changed

10 files changed

+26
-10
lines changed

pkg/kv/kvserver/batcheval/main_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"os"
1010
"testing"
1111

12+
"github.com/cockroachdb/cockroach/pkg/base"
1213
"github.com/cockroachdb/cockroach/pkg/security/securityassets"
1314
"github.com/cockroachdb/cockroach/pkg/security/securitytest"
1415
"github.com/cockroachdb/cockroach/pkg/server"
@@ -24,7 +25,8 @@ func init() {
2425
}
2526
func TestMain(m *testing.M) {
2627
randutil.SeedForTests()
27-
serverutils.InitTestServerFactory(server.TestServerFactory)
28+
serverutils.InitTestServerFactory(server.TestServerFactory,
29+
serverutils.WithDRPCOption(base.TestDRPCEnabledRandomly))
2830
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
2931

3032
code := m.Run()

pkg/kv/kvserver/intentresolver/main_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ func init() {
2222

2323
func TestMain(m *testing.M) {
2424
randutil.SeedForTests()
25-
serverutils.InitTestServerFactory(server.TestServerFactory)
25+
serverutils.InitTestServerFactory(server.TestServerFactory,
26+
serverutils.WithDRPCOption(base.TestDRPCEnabledRandomly))
2627

2728
defer serverutils.TestingSetDefaultTenantSelectionOverride(
2829
// All the tests in this package are specific to the storage layer.

pkg/kv/kvserver/liveness/main_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import (
2121
func TestMain(m *testing.M) {
2222
securityassets.SetLoader(securitytest.EmbeddedAssets)
2323
randutil.SeedForTests()
24-
serverutils.InitTestServerFactory(server.TestServerFactory)
24+
serverutils.InitTestServerFactory(server.TestServerFactory,
25+
serverutils.WithDRPCOption(base.TestDRPCEnabledRandomly))
2526
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
2627

2728
defer serverutils.TestingSetDefaultTenantSelectionOverride(

pkg/kv/kvserver/loqrecovery/main_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import (
2121
func TestMain(m *testing.M) {
2222
securityassets.SetLoader(securitytest.EmbeddedAssets)
2323
randutil.SeedForTests()
24-
serverutils.InitTestServerFactory(server.TestServerFactory)
24+
serverutils.InitTestServerFactory(server.TestServerFactory,
25+
serverutils.WithDRPCOption(base.TestDRPCDisabled))
2526
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
2627

2728
// All the tests in this package exercise the storage layer.

pkg/kv/kvserver/protectedts/ptcache/main_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"os"
1010
"testing"
1111

12+
"github.com/cockroachdb/cockroach/pkg/base"
1213
"github.com/cockroachdb/cockroach/pkg/security/securityassets"
1314
"github.com/cockroachdb/cockroach/pkg/security/securitytest"
1415
"github.com/cockroachdb/cockroach/pkg/server"
@@ -20,7 +21,8 @@ import (
2021
func TestMain(m *testing.M) {
2122
securityassets.SetLoader(securitytest.EmbeddedAssets)
2223
randutil.SeedForTests()
23-
serverutils.InitTestServerFactory(server.TestServerFactory)
24+
serverutils.InitTestServerFactory(server.TestServerFactory,
25+
serverutils.WithDRPCOption(base.TestDRPCEnabledRandomly))
2426
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
2527
os.Exit(m.Run())
2628
}

pkg/kv/kvserver/protectedts/ptreconcile/main_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"os"
1010
"testing"
1111

12+
"github.com/cockroachdb/cockroach/pkg/base"
1213
"github.com/cockroachdb/cockroach/pkg/security/securityassets"
1314
"github.com/cockroachdb/cockroach/pkg/security/securitytest"
1415
"github.com/cockroachdb/cockroach/pkg/server"
@@ -19,6 +20,7 @@ import (
1920
func TestMain(m *testing.M) {
2021
securityassets.SetLoader(securitytest.EmbeddedAssets)
2122
randutil.SeedForTests()
22-
serverutils.InitTestServerFactory(server.TestServerFactory)
23+
serverutils.InitTestServerFactory(server.TestServerFactory,
24+
serverutils.WithDRPCOption(base.TestDRPCEnabledRandomly))
2325
os.Exit(m.Run())
2426
}

pkg/kv/kvserver/protectedts/ptstorage/main_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"os"
1010
"testing"
1111

12+
"github.com/cockroachdb/cockroach/pkg/base"
1213
"github.com/cockroachdb/cockroach/pkg/security/securityassets"
1314
"github.com/cockroachdb/cockroach/pkg/security/securitytest"
1415
"github.com/cockroachdb/cockroach/pkg/server"
@@ -20,7 +21,8 @@ import (
2021
func TestMain(m *testing.M) {
2122
securityassets.SetLoader(securitytest.EmbeddedAssets)
2223
randutil.SeedForTests()
23-
serverutils.InitTestServerFactory(server.TestServerFactory)
24+
serverutils.InitTestServerFactory(server.TestServerFactory,
25+
serverutils.WithDRPCOption(base.TestDRPCEnabledRandomly))
2426
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
2527
os.Exit(m.Run())
2628
}

pkg/kv/kvserver/rangelog/main_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"os"
1010
"testing"
1111

12+
"github.com/cockroachdb/cockroach/pkg/base"
1213
"github.com/cockroachdb/cockroach/pkg/security/securityassets"
1314
"github.com/cockroachdb/cockroach/pkg/security/securitytest"
1415
"github.com/cockroachdb/cockroach/pkg/server"
@@ -20,7 +21,8 @@ import (
2021
func TestMain(m *testing.M) {
2122
securityassets.SetLoader(securitytest.EmbeddedAssets)
2223
randutil.SeedForTests()
23-
serverutils.InitTestServerFactory(server.TestServerFactory)
24+
serverutils.InitTestServerFactory(server.TestServerFactory,
25+
serverutils.WithDRPCOption(base.TestDRPCEnabledRandomly))
2426
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
2527
os.Exit(m.Run())
2628
}

pkg/kv/kvserver/reports/main_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import (
2020
func TestMain(m *testing.M) {
2121
securityassets.SetLoader(securitytest.EmbeddedAssets)
2222
randutil.SeedForTests()
23-
serverutils.InitTestServerFactory(server.TestServerFactory)
23+
serverutils.InitTestServerFactory(server.TestServerFactory,
24+
serverutils.WithDRPCOption(base.TestDRPCEnabledRandomly))
2425
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
2526

2627
defer serverutils.TestingSetDefaultTenantSelectionOverride(

pkg/kv/kvserver/storeliveness/main_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"os"
1010
"testing"
1111

12+
"github.com/cockroachdb/cockroach/pkg/base"
1213
"github.com/cockroachdb/cockroach/pkg/security/securityassets"
1314
"github.com/cockroachdb/cockroach/pkg/security/securitytest"
1415
"github.com/cockroachdb/cockroach/pkg/server"
@@ -18,7 +19,8 @@ import (
1819

1920
func TestMain(m *testing.M) {
2021
securityassets.SetLoader(securitytest.EmbeddedAssets)
21-
serverutils.InitTestServerFactory(server.TestServerFactory)
22+
serverutils.InitTestServerFactory(server.TestServerFactory,
23+
serverutils.WithDRPCOption(base.TestDRPCEnabledRandomly))
2224
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
2325
os.Exit(m.Run())
2426
}

0 commit comments

Comments
 (0)