Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
109073: jobs: remove spurious calls to `settings.TestingSaveRegistry` r=stevendanna a=knz

Epic: CRDB-28893
Release note: None

Co-authored-by: Raphael 'kena' Poss <[email protected]>
  • Loading branch information
craig[bot] and knz committed Aug 19, 2023
2 parents 0352a78 + a8e0cb5 commit c4eda8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 3 additions & 5 deletions pkg/jobs/job_scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,19 +201,18 @@ func TestJobSchedulerDaemonInitialScanDelay(t *testing.T) {
}
}

func getScopedSettings() (*settings.Values, func()) {
func getScopedSettings() *settings.Values {
sv := &settings.Values{}
sv.Init(context.Background(), nil)
return sv, settings.TestingSaveRegistry()
return sv
}

func TestJobSchedulerDaemonGetWaitPeriod(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
ctx := context.Background()

sv, cleanup := getScopedSettings()
defer cleanup()
sv := getScopedSettings()

noJitter := func(d time.Duration) time.Duration { return d }

Expand Down Expand Up @@ -576,7 +575,6 @@ func TestJobSchedulerRetriesFailed(t *testing.T) {
func TestJobSchedulerDaemonUsesSystemTables(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
defer settings.TestingSaveRegistry()()

// Make daemon run quickly.
knobs := &TestingKnobs{
Expand Down
3 changes: 0 additions & 3 deletions pkg/jobs/testutils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/cockroachdb/cockroach/pkg/jobs/jobstest"
"github.com/cockroachdb/cockroach/pkg/scheduledjobs"
"github.com/cockroachdb/cockroach/pkg/security/username"
"github.com/cockroachdb/cockroach/pkg/settings"
"github.com/cockroachdb/cockroach/pkg/sql/isql"
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
"github.com/cockroachdb/cockroach/pkg/sql/sessiondata"
Expand Down Expand Up @@ -90,7 +89,6 @@ func newTestHelperForTables(
sqlDB.Exec(t, jobstest.GetJobsTableSchema(env))
}

restoreRegistry := settings.TestingSaveRegistry()
return &testHelper{
env: env,
server: s,
Expand All @@ -107,7 +105,6 @@ func newTestHelperForTables(
sqlDB.Exec(t, "DROP TABLE "+env.ScheduledJobsTableName())
}
s.Stopper().Stop(context.Background())
restoreRegistry()
}
}

Expand Down

0 comments on commit c4eda8e

Please sign in to comment.