Skip to content
Merged
Changes from all commits
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
13 changes: 11 additions & 2 deletions pkg/ttl/ttlworker/scan_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"fmt"
"math/rand/v2"
"strings"
"sync"
"testing"
"time"
Expand All @@ -39,8 +40,16 @@ func TestCancelWhileScan(t *testing.T) {
tk.MustExec("create table test.t (id int, created_at datetime) TTL= created_at + interval 1 hour")
testTable, err := dom.InfoSchema().TableByName(context.Background(), ast.NewCIStr("test"), ast.NewCIStr("t"))
require.NoError(t, err)
for i := range 10000 {
tk.MustExec(fmt.Sprintf("insert into test.t values (%d, NOW() - INTERVAL 24 HOUR)", i))
totalRows, batchSize := 1000, 100
if testflag.Long() {
totalRows = 10000
}
for i := 0; i < totalRows; i += batchSize {
values := make([]string, 0, batchSize)
for j := i; j < i+batchSize; j++ {
values = append(values, fmt.Sprintf("(%d, NOW() - INTERVAL 24 HOUR)", j))
}
tk.MustExec("insert into test.t values " + strings.Join(values, ","))
}
testPhysicalTableCache, err := cache.NewPhysicalTable(ast.NewCIStr("test"), testTable.Meta(), ast.NewCIStr(""))
require.NoError(t, err)
Expand Down
Loading