@@ -40,7 +40,7 @@ func submitTaskAndCheckSuccessForBasic(ctx context.Context, t *testing.T, taskKe
40
40
41
41
func submitTaskAndCheckSuccess (ctx context.Context , t * testing.T , taskKey string ,
42
42
testContext * testutil.TestContext , subtaskCnts map [proto.Step ]int ) {
43
- task := testutil .SubmitAndWaitTask (ctx , t , taskKey )
43
+ task := testutil .SubmitAndWaitTask (ctx , t , taskKey , 1 )
44
44
require .Equal (t , proto .TaskStateSucceed , task .State )
45
45
for step , cnt := range subtaskCnts {
46
46
require .Equal (t , cnt , testContext .CollectedSubtaskCnt (task .ID , step ))
@@ -130,7 +130,7 @@ func TestFrameworkCancelTask(t *testing.T) {
130
130
defer func () {
131
131
require .NoError (t , failpoint .Disable ("github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor/MockExecutorRunCancel" ))
132
132
}()
133
- task := testutil .SubmitAndWaitTask (c .Ctx , t , "key1" )
133
+ task := testutil .SubmitAndWaitTask (c .Ctx , t , "key1" , 1 )
134
134
require .Equal (t , proto .TaskStateReverted , task .State )
135
135
}
136
136
@@ -142,7 +142,7 @@ func TestFrameworkSubTaskFailed(t *testing.T) {
142
142
defer func () {
143
143
require .NoError (t , failpoint .Disable ("github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor/MockExecutorRunErr" ))
144
144
}()
145
- task := testutil .SubmitAndWaitTask (c .Ctx , t , "key1" )
145
+ task := testutil .SubmitAndWaitTask (c .Ctx , t , "key1" , 1 )
146
146
require .Equal (t , proto .TaskStateReverted , task .State )
147
147
}
148
148
@@ -153,7 +153,7 @@ func TestFrameworkSubTaskInitEnvFailed(t *testing.T) {
153
153
defer func () {
154
154
require .NoError (t , failpoint .Disable ("github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor/mockExecSubtaskInitEnvErr" ))
155
155
}()
156
- task := testutil .SubmitAndWaitTask (c .Ctx , t , "key1" )
156
+ task := testutil .SubmitAndWaitTask (c .Ctx , t , "key1" , 1 )
157
157
require .Equal (t , proto .TaskStateReverted , task .State )
158
158
}
159
159
@@ -212,7 +212,7 @@ func TestFrameworkSubtaskFinishedCancel(t *testing.T) {
212
212
defer func () {
213
213
require .NoError (t , failpoint .Disable ("github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor/MockSubtaskFinishedCancel" ))
214
214
}()
215
- task := testutil .SubmitAndWaitTask (c .Ctx , t , "key1" )
215
+ task := testutil .SubmitAndWaitTask (c .Ctx , t , "key1" , 1 )
216
216
require .Equal (t , proto .TaskStateReverted , task .State )
217
217
}
218
218
@@ -221,7 +221,7 @@ func TestFrameworkRunSubtaskCancel(t *testing.T) {
221
221
222
222
testutil .RegisterTaskMeta (t , c .MockCtrl , testutil .GetMockBasicSchedulerExt (c .MockCtrl ), c .TestContext , nil )
223
223
require .NoError (t , failpoint .Enable ("github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor/MockRunSubtaskCancel" , "1*return(true)" ))
224
- task := testutil .SubmitAndWaitTask (c .Ctx , t , "key1" )
224
+ task := testutil .SubmitAndWaitTask (c .Ctx , t , "key1" , 1 )
225
225
require .Equal (t , proto .TaskStateReverted , task .State )
226
226
require .NoError (t , failpoint .Disable ("github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor/MockRunSubtaskCancel" ))
227
227
}
@@ -270,7 +270,7 @@ func TestTaskCancelledBeforeUpdateTask(t *testing.T) {
270
270
271
271
testutil .RegisterTaskMeta (t , c .MockCtrl , testutil .GetMockBasicSchedulerExt (c .MockCtrl ), c .TestContext , nil )
272
272
require .NoError (t , failpoint .Enable ("github.com/pingcap/tidb/pkg/disttask/framework/scheduler/cancelBeforeUpdateTask" , "1*return(true)" ))
273
- task := testutil .SubmitAndWaitTask (c .Ctx , t , "key1" )
273
+ task := testutil .SubmitAndWaitTask (c .Ctx , t , "key1" , 1 )
274
274
require .Equal (t , proto .TaskStateReverted , task .State )
275
275
require .NoError (t , failpoint .Disable ("github.com/pingcap/tidb/pkg/disttask/framework/scheduler/cancelBeforeUpdateTask" ))
276
276
}
0 commit comments