Skip to content

Commit

Permalink
ddl: fix flaky TestGenIDAndInsertJobsWithRetry (#55233)
Browse files Browse the repository at this point in the history
close #55232
  • Loading branch information
D3Hunter authored Aug 6, 2024
1 parent 977a5bf commit dff0d7c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/ddl/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,15 @@ func TestGenIDAndInsertJobsWithRetry(t *testing.T) {
}}
initialGID := getGlobalID(ctx, t, store)
threads, iterations := 10, 500
tks := make([]*testkit.TestKit, threads)
for i := 0; i < threads; i++ {
tks[i] = testkit.NewTestKit(t, store)
}
var wg util.WaitGroupWrapper
for i := 0; i < threads; i++ {
idx := i
wg.Run(func() {
kit := testkit.NewTestKit(t, store)
kit := tks[idx]
ddlSe := sess.NewSession(kit.Session())
for j := 0; j < iterations; j++ {
require.NoError(t, ddl.GenGIDAndInsertJobsWithRetry(ctx, ddlSe, jobs))
Expand Down

0 comments on commit dff0d7c

Please sign in to comment.