Skip to content

Commit dcdbb6d

Browse files
committed
drpc: run SQL catalog 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: #155574 Release note: None
1 parent b3d51ac commit dcdbb6d

File tree

12 files changed

+23
-2
lines changed

12 files changed

+23
-2
lines changed

pkg/sql/catalog/bootstrap/main_test.go

Lines changed: 2 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,6 +25,6 @@ func TestMain(m *testing.M) {
2425
randutil.SeedForTests()
2526
serverutils.InitTestServerFactory(server.TestServerFactory)
2627
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
27-
28+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
2829
os.Exit(m.Run())
2930
}

pkg/sql/catalog/descs/main_test.go

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

11+
"github.com/cockroachdb/cockroach/pkg/base"
1112
"github.com/cockroachdb/cockroach/pkg/security/securityassets"
1213
"github.com/cockroachdb/cockroach/pkg/security/securitytest"
1314
"github.com/cockroachdb/cockroach/pkg/server"
@@ -21,7 +22,7 @@ func TestMain(m *testing.M) {
2122
randutil.SeedForTests()
2223
serverutils.InitTestServerFactory(server.TestServerFactory)
2324
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
24-
25+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
2526
os.Exit(m.Run())
2627
}
2728

pkg/sql/catalog/externalcatalog/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/catalog/internal/catkv/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
randutil.SeedForTests()
2223
serverutils.InitTestServerFactory(server.TestServerFactory)
24+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
2325
os.Exit(m.Run())
2426
}

pkg/sql/catalog/lease/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"
@@ -27,5 +28,6 @@ func TestMain(m *testing.M) {
2728
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
2829
// Disable create table with schema_locked for this entire package.
2930
sql.TestForceDisableCreateTableWithSchemaLocked()
31+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
3032
os.Exit(m.Run())
3133
}

pkg/sql/catalog/redact/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
securityassets.SetLoader(securitytest.EmbeddedAssets)
2324
serverutils.InitTestServerFactory(server.TestServerFactory)
2425
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
26+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
2527
os.Exit(m.Run())
2628
}

pkg/sql/catalog/resolver/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/catalog/schematelemetry/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
securityassets.SetLoader(securitytest.EmbeddedAssets)
2324
serverutils.InitTestServerFactory(server.TestServerFactory)
2425
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
26+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
2527
os.Exit(m.Run())
2628
}

pkg/sql/catalog/systemschema_test/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
randutil.SeedForTests()
2223
serverutils.InitTestServerFactory(server.TestServerFactory)
24+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
2325
os.Exit(m.Run())
2426
}

pkg/sql/catalog/tabledesc/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
randutil.SeedForTests()
2223
serverutils.InitTestServerFactory(server.TestServerFactory)
24+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
2325
os.Exit(m.Run())
2426
}

0 commit comments

Comments
 (0)