Skip to content

Commit

Permalink
Merge #69219
Browse files Browse the repository at this point in the history
69219: jobs: make TestPauseReason faster r=ajwerner a=sajjadrizvi

TestPauseReason waits for a job to be paused, which is slow because
job-registry's cancel-loop interval is 10s by default. This commit
uses a testing knob in the test to shorten cancel-loop interval,
which results in shorter test time.

Release note: None

Co-authored-by: Sajjad Rizvi <[email protected]>
  • Loading branch information
craig[bot] and Sajjad Rizvi committed Aug 22, 2021
2 parents d18da6c + 108ab62 commit 5d1148c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/jobs/jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3129,7 +3129,11 @@ func TestPauseReason(t *testing.T) {
defer log.Scope(t).Close(t)

ctx := context.Background()
s, db, _ := serverutils.StartServer(t, base.TestServerArgs{})
s, db, _ := serverutils.StartServer(t, base.TestServerArgs{
Knobs: base.TestingKnobs{
JobsTestingKnobs: jobs.NewTestingKnobsWithShortIntervals(),
},
})
registry := s.JobRegistry().(*jobs.Registry)
defer s.Stopper().Stop(ctx)

Expand Down

0 comments on commit 5d1148c

Please sign in to comment.