Skip to content

Commit 41a71f8

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

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

pkg/sql/physicalplan/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/sqlstats/persistedsqlstats/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/sqlstats/sslocal/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/stats/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"
@@ -29,5 +30,6 @@ func TestMain(m *testing.M) {
2930
randutil.SeedForTests()
3031
serverutils.InitTestServerFactory(server.TestServerFactory)
3132
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
33+
serverutils.TestingGlobalDRPCOption(base.TestDRPCEnabledRandomly)
3234
os.Exit(m.Run())
3335
}

pkg/sql/stmtdiagnostics/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
}

0 commit comments

Comments
 (0)