Skip to content

Commit

Permalink
ttl: use a standalone manager in TriggerScanTask test (#40816)
Browse files Browse the repository at this point in the history
close #40811
  • Loading branch information
YangKeao committed Jan 29, 2023
1 parent 90c5a87 commit d22795a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions ttl/ttlworker/job_manager_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,17 +434,23 @@ func TestTriggerScanTask(t *testing.T) {
store, dom := testkit.CreateMockStoreAndDomain(t)
tk := testkit.NewTestKit(t, store)
sessionFactory := sessionFactory(t, store)

now := time.Now()

se := sessionFactory()
m := dom.TTLJobManager()
m.TaskManager().ResizeWorkersWithSysVar()
nCli := m.GetNotificationCli()

waitAndStopTTLManager(t, dom)

tk.MustExec("create table test.t (id int, created_at datetime) ttl = `created_at` + interval 1 minute ttl_job_interval = '1m'")

m := ttlworker.NewJobManager("manager-1", nil, store, nil)
require.NoError(t, m.InfoSchemaCache().Update(se))
m.TaskManager().ResizeWorkersWithSysVar()
m.Start()
defer func() {
m.Stop()
require.NoError(t, m.WaitStopped(context.Background(), time.Second*10))
}()

nCli := m.GetNotificationCli()
wg := &sync.WaitGroup{}
wg.Add(1)
go func() {
Expand Down

0 comments on commit d22795a

Please sign in to comment.