Skip to content

test: [DNM] Test test task manager entry size #61222

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
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
22 changes: 22 additions & 0 deletions pkg/disttask/framework/storage/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package storage_test
import (
"context"
"fmt"
"runtime"
"slices"
"sort"
"testing"
Expand All @@ -31,6 +32,7 @@ import (
"github.com/pingcap/tidb/pkg/sessionctx/vardef"
"github.com/pingcap/tidb/pkg/testkit"
"github.com/pingcap/tidb/pkg/testkit/testfailpoint"
tidbutil "github.com/pingcap/tidb/pkg/util"
"github.com/pingcap/tidb/pkg/util/sqlexec"
"github.com/stretchr/testify/require"
"github.com/tikv/client-go/v2/util"
Expand Down Expand Up @@ -1190,6 +1192,24 @@ func TestGetActiveTaskExecInfo(t *testing.T) {
}

func TestTaskManagerEntrySize(t *testing.T) {
// t.Skip(`this case is used to verify that the global TxnEntrySizeLimit is used in DXF,
//it success in local test, and success in CI in most cases, but it times out sometimes,
//one guess is it's related to the uni-store storage badger,
//to avoid block CI, skip it, as we have already verified it works`)
var wg tidbutil.WaitGroupWrapper
bgCtx, cancelFunc := context.WithCancel(context.Background())
wg.Run(func() {
for {
select {
case <-bgCtx.Done():
return
case <-time.After(10 * time.Second):
}
buf := make([]byte, 8<<20)
stackLen := runtime.Stack(buf, true)
t.Logf("\n\n\n\n=== dump goroutine stack. ===\n%s\n\n\n", string(buf[:stackLen]))
}
})
store, tm, ctx := testutil.InitTableTest(t)
getMeta := func(l int) []byte {
meta := make([]byte, l)
Expand All @@ -1214,4 +1234,6 @@ func TestTaskManagerEntrySize(t *testing.T) {
require.NoError(t, insertSubtask(meta6m))
// TiKV also have a limit raftstore.raft-entry-max-size which is 8M by default,
// we won't test that param here
cancelFunc()
wg.Wait()
}