Skip to content

Commit 86d6f0c

Browse files
committed
server,tests: explicitly disable DRPC setting if option is TestDRPCDisabled
This change ensures a clear distinction between an unset DRPC option and an explicitly disabled one. If the DRPC option is unset at both the test and package levels, we will not modify the setting. This allows the system to use the default value of `ExperimentalDRPCEnabled`, which can be overridden for development via `COCKROACH_EXPERIMENTAL_DRPC_ENABLED`. When the option is explicitly set to `TestDRPCDisabled`, we will now explicitly disable the setting. Release note: none Epic: none
1 parent 80ceb18 commit 86d6f0c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pkg/server/testserver.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,11 @@ func makeTestConfigFromParams(params base.TestServerArgs) Config {
333333
cfg.TestingKnobs.AdmissionControlOptions = &admission.Options{}
334334
}
335335

336-
if params.DefaultDRPCOption == base.TestDRPCEnabled {
336+
switch params.DefaultDRPCOption {
337+
case base.TestDRPCEnabled:
337338
rpcbase.ExperimentalDRPCEnabled.Override(context.Background(), &st.SV, true)
339+
case base.TestDRPCDisabled:
340+
rpcbase.ExperimentalDRPCEnabled.Override(context.Background(), &st.SV, false)
338341
}
339342

340343
return cfg

pkg/testutils/serverutils/test_server_shim.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,8 @@ func ShouldEnableDRPC(
555555
case base.TestDRPCEnabledRandomly:
556556
rng, _ := randutil.NewTestRand()
557557
enableDRPC = rng.Intn(2) == 0
558+
case base.TestDRPCUnset:
559+
return base.TestDRPCUnset
558560
}
559561

560562
if enableDRPC {

0 commit comments

Comments
 (0)