Skip to content

Commit

Permalink
use a standalone manager in test
Browse files Browse the repository at this point in the history
Signed-off-by: YangKeao <[email protected]>
  • Loading branch information
YangKeao committed Jan 29, 2023
1 parent 8b1058d commit a6700c9
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 a6700c9

Please sign in to comment.