Skip to content

Commit

Permalink
diagnosticsccl: remove uses of TODOTestTenantDisabled
Browse files Browse the repository at this point in the history
Followup issue: cockroachdb#106901

Release note: None
  • Loading branch information
knz committed Jul 17, 2023
1 parent 9bec620 commit 1ed2e7f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions pkg/ccl/serverccl/diagnosticsccl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ go_test(
tags = ["ccl_test"],
deps = [
"//pkg/base",
"//pkg/ccl",
"//pkg/ccl/kvccl/kvtenantccl",
"//pkg/clusterversion",
"//pkg/config/zonepb",
Expand Down
2 changes: 2 additions & 0 deletions pkg/ccl/serverccl/diagnosticsccl/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"os"
"testing"

"github.com/cockroachdb/cockroach/pkg/ccl"
"github.com/cockroachdb/cockroach/pkg/ccl/kvccl/kvtenantccl"
"github.com/cockroachdb/cockroach/pkg/security/securityassets"
"github.com/cockroachdb/cockroach/pkg/security/securitytest"
Expand All @@ -23,5 +24,6 @@ func TestMain(m *testing.M) {
securityassets.SetLoader(securitytest.EmbeddedAssets)
serverutils.InitTestServerFactory(server.TestServerFactory)
kvtenantccl.InitConnectorFactory()
defer ccl.TestingEnableEnterprise()()
os.Exit(m.Run())
}
10 changes: 6 additions & 4 deletions pkg/ccl/serverccl/diagnosticsccl/reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestTenantReport(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)

rt := startReporterTest(t, base.TODOTestTenantDisabled)
rt := startReporterTest(t, base.TestControlsTenantsExplicitly)
defer rt.Close()

tenantArgs := base.TestTenantArgs{
Expand Down Expand Up @@ -99,8 +99,7 @@ func TestServerReport(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)

var defaultTestTenant base.DefaultTestTenantOptions
rt := startReporterTest(t, defaultTestTenant)
rt := startReporterTest(t, base.TestIsSpecificToStorageLayerAndNeedsASystemTenant)
defer rt.Close()

ctx := context.Background()
Expand Down Expand Up @@ -289,6 +288,8 @@ func TestUsageQuantization(t *testing.T) {

url := r.URL()
s, db, _ := serverutils.StartServer(t, base.TestServerArgs{
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(106901),

Settings: st,
Knobs: base.TestingKnobs{
Server: &server.TestingKnobs{
Expand All @@ -299,7 +300,6 @@ func TestUsageQuantization(t *testing.T) {
},
})
defer s.Stopper().Stop(ctx)
ts := s.(*server.TestServer)

// Disable periodic reporting so it doesn't interfere with the test.
if _, err := db.Exec(`SET CLUSTER SETTING diagnostics.reporting.enabled = false`); err != nil {
Expand Down Expand Up @@ -331,6 +331,8 @@ func TestUsageQuantization(t *testing.T) {
require.NoError(t, err)
}

ts := s.TenantOrServer()

// Flush the SQL stat pool.
ts.SQLServer().(*sql.Server).GetSQLStatsController().ResetLocalSQLStats(ctx)

Expand Down

0 comments on commit 1ed2e7f

Please sign in to comment.