Skip to content

Commit

Permalink
test: fix unstable TestAdminShowNextID (#56002)
Browse files Browse the repository at this point in the history
close #55828
  • Loading branch information
tangenta authored Sep 13, 2024
1 parent e471433 commit f0ac8f4
Showing 1 changed file with 3 additions and 5 deletions.
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

0 comments on commit f0ac8f4

Please sign in to comment.