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

test: fix unstable TestAdminShowNextID #56002

Merged
merged 1 commit into from
Sep 13, 2024
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
8 changes: 3 additions & 5 deletions pkg/executor/test/seqtest/seq_executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,8 @@ func checkGoroutineExists(keyword string) bool {
}

func TestAdminShowNextID(t *testing.T) {
step := int64(10)
autoid.SetStep(step)
store := testkit.CreateMockStore(t)

HelperTestAdminShowNextID(t, store, `admin show `)
Expand All @@ -771,10 +773,6 @@ func HelperTestAdminShowNextID(t *testing.T, store kv.Storage, str string) {
defer func() {
require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/meta/autoid/mockAutoIDChange"))
}()
step := int64(10)
autoIDStep := autoid.GetStep()
autoid.SetStep(step)
defer autoid.SetStep(autoIDStep)
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("drop table if exists t,tt")
Expand All @@ -787,7 +785,7 @@ func HelperTestAdminShowNextID(t *testing.T, store kv.Storage, str string) {
r = tk.MustQuery(str + " t next_row_id")
r.Check(testkit.Rows("test t _tidb_rowid 11 _TIDB_ROWID"))
// Row ID is original + step.
for i := 0; i < int(step); i++ {
for i := 0; i < int(10); i++ {
tk.MustExec("insert into t values(10000, 1)")
}
r = tk.MustQuery(str + " t next_row_id")
Expand Down