Skip to content

Commit 1befb1f

Browse files
craig[bot]suj-krishnan
andcommitted
Merge #157188
157188: backup: run tests with DRPC randomly enabled r=suj-krishnan a=suj-krishnan This change introduces a package-level setting that randomly enables DRPC in pkg/backup. Epic: [CRDB-48935](https://cockroachlabs.atlassian.net/browse/CRDB-48935) Informs: #155569 Release note: None **Notes:** - Manual verification: Since the setting turns on/off randomly during test runs, the following command was used to manually verify that all combinations of the newly added setting and the existing tenant setting (that is also enabled randomly) pass. `./dev test pkg/backup/<subdir> -v -- --test_env=COCKROACH_TEST_TENANT=<true/false/shared/external> --test_env=COCKROACH_TEST_DRPC=<true/false> ` - The following tests are disabled in this PR because they currently fail with the following error: `"grpc: could not fetch metadata or no filename in metadata"` This is a known issue that has been root-caused to differences in how metadata is handled between grpc and drpc and work to fix this issue is in progress as per `@shubhamdhama.` Relevant slack thread - https://cockroachlabs.slack.com/archives/C06V95X6CVA/p1761751554364579 The tests can be enabled after the issue is fixed. Disabled tests: TestBackupRestoreResolveDestination All tests directly under pkg/backup Co-authored-by: Sujatha Sivaramakrishnan <[email protected]>
2 parents b07e9c2 + d182039 commit 1befb1f

File tree

6 files changed

+22
-1
lines changed

6 files changed

+22
-1
lines changed

pkg/backup/backupdest/backup_destination_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ func TestBackupRestoreResolveDestination(t *testing.T) {
3838
defer leaktest.AfterTest(t)()
3939
defer log.Scope(t).Close(t)
4040

41-
tc, _, _, cleanupFn := backuptestutils.StartBackupRestoreTestCluster(t, backuptestutils.MultiNode)
41+
var params base.TestClusterArgs
42+
params.ServerArgs.DefaultDRPCOption = base.TestDRPCDisabled
43+
44+
tc, _, _, cleanupFn := backuptestutils.StartBackupRestoreTestCluster(t,
45+
backuptestutils.MultiNode, backuptestutils.WithParams(params))
4246
defer cleanupFn()
4347

4448
ctx := context.Background()

pkg/backup/backupdest/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/ccl"
1314
"github.com/cockroachdb/cockroach/pkg/security/securityassets"
1415
"github.com/cockroachdb/cockroach/pkg/security/securitytest"
@@ -24,6 +25,9 @@ func TestMain(m *testing.M) {
2425
randutil.SeedForTests()
2526
serverutils.InitTestServerFactory(server.TestServerFactory)
2627
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
28+
defer serverutils.TestingGlobalDRPCOption(
29+
base.TestDRPCEnabledRandomly,
30+
)()
2731
os.Exit(m.Run())
2832
}
2933

pkg/backup/backupinfo/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/ccl"
1314
"github.com/cockroachdb/cockroach/pkg/security/securityassets"
1415
"github.com/cockroachdb/cockroach/pkg/security/securitytest"
@@ -24,6 +25,9 @@ func TestMain(m *testing.M) {
2425
randutil.SeedForTests()
2526
serverutils.InitTestServerFactory(server.TestServerFactory)
2627
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
28+
defer serverutils.TestingGlobalDRPCOption(
29+
base.TestDRPCEnabledRandomly,
30+
)()
2731
os.Exit(m.Run())
2832
}
2933

pkg/backup/backuprand/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/ccl"
1314
_ "github.com/cockroachdb/cockroach/pkg/ccl/storageccl"
1415
"github.com/cockroachdb/cockroach/pkg/security/securityassets"
@@ -25,6 +26,9 @@ func TestMain(m *testing.M) {
2526
randutil.SeedForTests()
2627
serverutils.InitTestServerFactory(server.TestServerFactory)
2728
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
29+
defer serverutils.TestingGlobalDRPCOption(
30+
base.TestDRPCEnabledRandomly,
31+
)()
2832
os.Exit(m.Run())
2933
}
3034

pkg/backup/backupresolver/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ go_test(
3131
],
3232
embed = [":backupresolver"],
3333
deps = [
34+
"//pkg/base",
3435
"//pkg/ccl/storageccl",
3536
"//pkg/keys",
3637
"//pkg/security/securityassets",

pkg/backup/backupresolver/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/ccl/storageccl"
1314
"github.com/cockroachdb/cockroach/pkg/security/securityassets"
1415
"github.com/cockroachdb/cockroach/pkg/security/securitytest"
@@ -23,6 +24,9 @@ func TestMain(m *testing.M) {
2324
randutil.SeedForTests()
2425
serverutils.InitTestServerFactory(server.TestServerFactory)
2526
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
27+
defer serverutils.TestingGlobalDRPCOption(
28+
base.TestDRPCEnabledRandomly,
29+
)()
2630
os.Exit(m.Run())
2731
}
2832

0 commit comments

Comments
 (0)