Skip to content

Commit 89f56cf

Browse files
committed
drpc: run SQL opt tests with DRPC enabled at random
This change introduces a package-level setting that randomly enables drpc in the sql package. Epic: CRDB-48935 Fixes: #155579 Release note: None
1 parent 834a3ca commit 89f56cf

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

pkg/sql/opt/exec/execbuilder/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ go_test(
7575
],
7676
embed = [":execbuilder"],
7777
deps = [
78+
"//pkg/base",
7879
"//pkg/security/securityassets",
7980
"//pkg/security/securitytest",
8081
"//pkg/server",

pkg/sql/opt/exec/execbuilder/main_test.go

Lines changed: 4 additions & 0 deletions
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,6 +25,9 @@ func TestMain(m *testing.M) {
2425
randutil.SeedForTests()
2526
serverutils.InitTestServerFactory(server.TestServerFactory)
2627
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
28+
// With DRPC enabled, its cluster setting "rpc.experimental_drpc.enabled"
29+
// interferes with some tests hence we disable it here.
30+
serverutils.TestingGlobalDRPCOption(base.TestDRPCDisabled)
2731

2832
os.Exit(m.Run())
2933
}

pkg/sql/opt/exec/explain/main_test.go

Lines changed: 2 additions & 0 deletions
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/ccl"
1314
"github.com/cockroachdb/cockroach/pkg/security/securityassets"
1415
"github.com/cockroachdb/cockroach/pkg/security/securitytest"
@@ -20,5 +21,6 @@ func TestMain(m *testing.M) {
2021
defer ccl.TestingEnableEnterprise()()
2122
securityassets.SetLoader(securitytest.EmbeddedAssets)
2223
serverutils.InitTestServerFactory(server.TestServerFactory)
24+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
2325
os.Exit(m.Run())
2426
}

pkg/sql/opt/main_test.go

Lines changed: 2 additions & 0 deletions
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,6 +21,7 @@ func TestMain(m *testing.M) {
2021
securityassets.SetLoader(securitytest.EmbeddedAssets)
2122
randutil.SeedForTests()
2223
serverutils.InitTestServerFactory(server.TestServerFactory)
24+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
2325

2426
os.Exit(m.Run())
2527
}

0 commit comments

Comments
 (0)