Skip to content

Commit c370cdd

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 e6352b3 commit c370cdd

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
@@ -512,6 +512,34 @@ func TestIsForStuffThatShouldWorkWithSharedProcessModeButDoesntYet(
512512
}
513513
}
514514

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