Skip to content

Commit

Permalink
spanconfigccl: remove uses of TODOTestTenantDisabled
Browse files Browse the repository at this point in the history
There's a mix of tests that control their tenants directly,
and tests that should really work with virtualization
enabled but don't.

Followup issues: cockroachdb#106821 and cockroachdb#106818.

Release note: None
  • Loading branch information
knz committed Jul 14, 2023
1 parent ebea3d4 commit c09c13e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestCommitTSIntervals(t *testing.T) {
var i interceptor
ts, _, _ := serverutils.StartServer(t, base.TestServerArgs{
// Manually starts a tenant below. No need to start one here.
DefaultTestTenant: base.TODOTestTenantDisabled,
DefaultTestTenant: base.TestControlsTenantsExplicitly,
Knobs: base.TestingKnobs{
Server: &server.TestingKnobs{
WallClock: manual,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ func TestDataDriven(t *testing.T) {
}
tc := testcluster.StartTestCluster(t, 1, base.TestClusterArgs{
ServerArgs: base.TestServerArgs{
// Test fails when run under the default test tenant. More
// investigation is required.
DefaultTestTenant: base.TODOTestTenantDisabled,
DefaultTestTenant: base.TestControlsTenantsExplicitly,
Knobs: base.TestingKnobs{
JobsTestingKnobs: jobs.NewTestingKnobsWithShortIntervals(), // speeds up test
SpanConfig: scKnobs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ func TestDataDriven(t *testing.T) {
datadriven.Walk(t, datapathutils.TestDataPath(t), func(t *testing.T, path string) {
tc := testcluster.StartTestCluster(t, 1, base.TestClusterArgs{
ServerArgs: base.TestServerArgs{
// Fails with nil pointer dereference. Tracked with #76378.
DefaultTestTenant: base.TODOTestTenantDisabled,
// Fails with nil pointer dereference. Tracked with #76378 and #106818.
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(106818),
Knobs: base.TestingKnobs{
SpanConfig: scKnobs,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,8 @@ func TestDataDriven(t *testing.T) {
datadriven.Walk(t, datapathutils.TestDataPath(t), func(t *testing.T, path string) {
tc := testcluster.StartTestCluster(t, 1, base.TestClusterArgs{
ServerArgs: base.TestServerArgs{
// Test fails when run within a tenant. More investigation
// is required. Tracked with #76378.
DefaultTestTenant: base.TODOTestTenantDisabled,
// Fails with nil pointer dereference. Tracked with #76378 and #106818.
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(106818),
Knobs: base.TestingKnobs{
GCJob: gcTestingKnobs,
SpanConfig: scKnobs,
Expand Down
25 changes: 10 additions & 15 deletions pkg/ccl/spanconfigccl/spanconfigsqlwatcherccl/sqlwatcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ func TestSQLWatcherReactsToUpdates(t *testing.T) {
defer dirCleanupFn()
tc := testcluster.StartTestCluster(t, 1, base.TestClusterArgs{
ServerArgs: base.TestServerArgs{
ExternalIODir: dir,
// Test already runs from a tenant.
DefaultTestTenant: base.TODOTestTenantDisabled,
ExternalIODir: dir,
DefaultTestTenant: base.TestControlsTenantsExplicitly,
Knobs: base.TestingKnobs{
SpanConfig: &spanconfig.TestingKnobs{
ManagerDisableJobCreation: true, // disable the automatic job creation.
Expand Down Expand Up @@ -288,8 +287,7 @@ func TestSQLWatcherMultiple(t *testing.T) {

tc := testcluster.StartTestCluster(t, 1, base.TestClusterArgs{
ServerArgs: base.TestServerArgs{
// Test already runs from a tenant.
DefaultTestTenant: base.TODOTestTenantDisabled,
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(106821),
Knobs: base.TestingKnobs{
SpanConfig: &spanconfig.TestingKnobs{
ManagerDisableJobCreation: true, // disable the automatic job creation.
Expand All @@ -307,7 +305,7 @@ func TestSQLWatcherMultiple(t *testing.T) {

noopCheckpointDuration := 100 * time.Millisecond
sqlWatcher := spanconfigsqlwatcher.New(
keys.SystemSQLCodec,
ts.Codec(),
ts.ClusterSettings(),
ts.RangeFeedFactory().(*rangefeed.Factory),
1<<20, /* 1 MB, bufferMemLimit */
Expand Down Expand Up @@ -420,8 +418,7 @@ func TestSQLWatcherOnEventError(t *testing.T) {

tc := testcluster.StartTestCluster(t, 1, base.TestClusterArgs{
ServerArgs: base.TestServerArgs{
// Test already runs from a tenant.
DefaultTestTenant: base.TODOTestTenantDisabled,
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(106821),
Knobs: base.TestingKnobs{
SpanConfig: &spanconfig.TestingKnobs{
ManagerDisableJobCreation: true, // disable the automatic job creation.
Expand All @@ -438,7 +435,7 @@ func TestSQLWatcherOnEventError(t *testing.T) {
tdb.Exec(t, `SET CLUSTER SETTING kv.closed_timestamp.target_duration = '100ms'`)

sqlWatcher := spanconfigsqlwatcher.New(
keys.SystemSQLCodec,
ts.Codec(),
ts.ClusterSettings(),
ts.RangeFeedFactory().(*rangefeed.Factory),
1<<20, /* 1 MB, bufferMemLimit */
Expand Down Expand Up @@ -471,8 +468,7 @@ func TestSQLWatcherHandlerError(t *testing.T) {

tc := testcluster.StartTestCluster(t, 1, base.TestClusterArgs{
ServerArgs: base.TestServerArgs{
// Test already runs from a tenant.
DefaultTestTenant: base.TODOTestTenantDisabled,
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(106821),
Knobs: base.TestingKnobs{
SpanConfig: &spanconfig.TestingKnobs{
ManagerDisableJobCreation: true, // disable the automatic job creation.
Expand All @@ -490,7 +486,7 @@ func TestSQLWatcherHandlerError(t *testing.T) {

noopCheckpointDuration := 100 * time.Millisecond
sqlWatcher := spanconfigsqlwatcher.New(
keys.SystemSQLCodec,
ts.Codec(),
ts.ClusterSettings(),
ts.RangeFeedFactory().(*rangefeed.Factory),
1<<20, /* 1 MB, bufferMemLimit */
Expand Down Expand Up @@ -549,8 +545,7 @@ func TestWatcherReceivesNoopCheckpoints(t *testing.T) {

tc := testcluster.StartTestCluster(t, 1, base.TestClusterArgs{
ServerArgs: base.TestServerArgs{
// Test already runs from a tenant.
DefaultTestTenant: base.TODOTestTenantDisabled,
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(106821),
Knobs: base.TestingKnobs{
SpanConfig: &spanconfig.TestingKnobs{
ManagerDisableJobCreation: true, // disable the automatic job creation.
Expand All @@ -568,7 +563,7 @@ func TestWatcherReceivesNoopCheckpoints(t *testing.T) {

noopCheckpointDuration := 25 * time.Millisecond
sqlWatcher := spanconfigsqlwatcher.New(
keys.SystemSQLCodec,
ts.Codec(),
ts.ClusterSettings(),
ts.RangeFeedFactory().(*rangefeed.Factory),
1<<20, /* 1 MB, bufferMemLimit */
Expand Down

0 comments on commit c09c13e

Please sign in to comment.