Skip to content

Commit bf124c9

Browse files
committed
sql: enable shared-process mode tenant testing for TestUnsplitRanges
I opened issue #142388 to track the work for enabling external-process mode testing, as it turned out to be a non-trivial effort.
1 parent 8d15893 commit bf124c9

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

pkg/base/test_server_args.go

+28
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,34 @@ func TestIsForStuffThatShouldWorkWithSharedProcessModeButDoesntYet(
519519
}
520520
}
521521

522+
// TestSkippedForExternalModeDueToPerformance can be used to disable selecting
523+
// the external process virtual cluster due to significant performance
524+
// degradation compared to other modes. However, the goal is to eventually make
525+
// it work efficiently in external mode.
526+
//
527+
// It should link to a github issue with label C-investigation.
528+
func TestSkippedForExternalModeDueToPerformance(issueNumber int) DefaultTestTenantOptions {
529+
return testSkippedForExternalProcessMode(issueNumber)
530+
}
531+
532+
// TestDoesNotWorkWithExternalProcessMode disables selecting the external
533+
// process virtual cluster for tests that are not functional in that mode and
534+
// require further investigation. Any test using this function should reference
535+
// a GitHub issue tagged with "C-investigation" describing the underlying
536+
// problem.
537+
func TestDoesNotWorkWithExternalProcessMode(issueNumber int) DefaultTestTenantOptions {
538+
return testSkippedForExternalProcessMode(issueNumber)
539+
}
540+
541+
func testSkippedForExternalProcessMode(issueNumber int) DefaultTestTenantOptions {
542+
return DefaultTestTenantOptions{
543+
testBehavior: ttSharedProcess,
544+
allowAdditionalTenants: true,
545+
issueNum: issueNumber,
546+
label: "C-investigation",
547+
}
548+
}
549+
522550
// InternalNonDefaultDecision builds a sentinel value used inside a
523551
// mechanism in serverutils. Should not be used by tests directly.
524552
func InternalNonDefaultDecision(

pkg/sql/unsplit_range_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"errors"
1313
"testing"
1414

15+
"github.com/cockroachdb/cockroach/pkg/base"
1516
"github.com/cockroachdb/cockroach/pkg/jobs"
1617
"github.com/cockroachdb/cockroach/pkg/keys"
1718
"github.com/cockroachdb/cockroach/pkg/kv"
@@ -269,7 +270,8 @@ func TestUnsplitRanges(t *testing.T) {
269270

270271
ctx := context.Background()
271272
run := func(t *testing.T, tc testCase) {
272-
params, _ := createTestServerParams()
273+
params, _ := createTestServerParamsAllowTenants()
274+
params.DefaultTestTenant = base.TestDoesNotWorkWithExternalProcessMode(142388)
273275
params.Knobs.JobsTestingKnobs = jobs.NewTestingKnobsWithShortIntervals()
274276
params.Knobs.GCJob = &sql.GCJobTestingKnobs{
275277
SkipWaitingForMVCCGC: true,

0 commit comments

Comments
 (0)