Skip to content

Commit ea34a96

Browse files
committed
drpc: run SQL 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: #155582 Release note: None
1 parent 41a71f8 commit ea34a96

File tree

33 files changed

+62
-3
lines changed

33 files changed

+62
-3
lines changed

pkg/sql/contention/txnidcache/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,5 +21,6 @@ func TestMain(m *testing.M) {
2021
securityassets.SetLoader(securitytest.EmbeddedAssets)
2122
serverutils.InitTestServerFactory(server.TestServerFactory)
2223
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
24+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
2325
os.Exit(m.Run())
2426
}

pkg/sql/copy/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"
@@ -22,5 +23,6 @@ func TestMain(m *testing.M) {
2223
randutil.SeedForTests()
2324
serverutils.InitTestServerFactory(server.TestServerFactory)
2425
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
26+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
2527
os.Exit(m.Run())
2628
}

pkg/sql/descmetadata/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ go_test(
2525
name = "descmetadata_test",
2626
srcs = ["main_test.go"],
2727
deps = [
28+
"//pkg/base",
2829
"//pkg/security/securityassets",
2930
"//pkg/security/securitytest",
3031
"//pkg/server",

pkg/sql/descmetadata/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"
@@ -22,5 +23,6 @@ func TestMain(m *testing.M) {
2223
randutil.SeedForTests()
2324
serverutils.InitTestServerFactory(server.TestServerFactory)
2425
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
26+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
2527
os.Exit(m.Run())
2628
}

pkg/sql/distsql/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"
@@ -24,5 +25,6 @@ func TestMain(m *testing.M) {
2425
randutil.SeedForTests()
2526
serverutils.InitTestServerFactory(server.TestServerFactory)
2627
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
28+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
2729
os.Exit(m.Run())
2830
}

pkg/sql/execinfra/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ go_test(
9393
],
9494
embed = [":execinfra"],
9595
deps = [
96+
"//pkg/base",
9697
"//pkg/security/securityassets",
9798
"//pkg/security/securitytest",
9899
"//pkg/server",

pkg/sql/execinfra/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"
@@ -24,5 +25,6 @@ func TestMain(m *testing.M) {
2425
randutil.SeedForTests()
2526
serverutils.InitTestServerFactory(server.TestServerFactory)
2627
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
28+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
2729
os.Exit(m.Run())
2830
}

pkg/sql/execstats/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,5 +21,6 @@ func TestMain(m *testing.M) {
2021
securityassets.SetLoader(securitytest.EmbeddedAssets)
2122
serverutils.InitTestServerFactory(server.TestServerFactory)
2223
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
24+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
2325
os.Exit(m.Run())
2426
}

pkg/sql/export/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"
@@ -22,6 +23,7 @@ func TestMain(m *testing.M) {
2223
randutil.SeedForTests()
2324
serverutils.InitTestServerFactory(server.TestServerFactory)
2425
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
26+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
2527
os.Exit(m.Run())
2628
}
2729

pkg/sql/flowinfra/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"
@@ -24,5 +25,6 @@ func TestMain(m *testing.M) {
2425
randutil.SeedForTests()
2526
serverutils.InitTestServerFactory(server.TestServerFactory)
2627
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
28+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
2729
os.Exit(m.Run())
2830
}

0 commit comments

Comments
 (0)