Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ttl: use a standalone manager in TriggerScanTask test #40816

Merged
merged 2 commits into from
Jan 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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