Support pausing jobs #104313
@ -185,7 +185,7 @@ func TestTaskStatusChangeCancelSingleTask(t *testing.T) {
|
|||||||
mocks.expectWriteTaskLogTimestamped(t, task, "task changed status active -> canceled")
|
mocks.expectWriteTaskLogTimestamped(t, task, "task changed status active -> canceled")
|
||||||
mocks.expectBroadcastTaskChange(task, api.TaskStatusActive, api.TaskStatusCanceled)
|
mocks.expectBroadcastTaskChange(task, api.TaskStatusActive, api.TaskStatusCanceled)
|
||||||
mocks.persist.EXPECT().CountTasksOfJobInStatus(ctx, job,
|
mocks.persist.EXPECT().CountTasksOfJobInStatus(ctx, job,
|
||||||
api.TaskStatusActive, api.TaskStatusQueued, api.TaskStatusSoftFailed, api.TaskStatusPaused).
|
api.TaskStatusActive, api.TaskStatusQueued, api.TaskStatusSoftFailed).
|
||||||
Return(1, 2, nil)
|
Return(1, 2, nil)
|
||||||
require.NoError(t, sm.TaskStatusChange(ctx, task, api.TaskStatusCanceled))
|
require.NoError(t, sm.TaskStatusChange(ctx, task, api.TaskStatusCanceled))
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ func TestTaskStatusChangeCancelSingleTask(t *testing.T) {
|
|||||||
mocks.expectWriteTaskLogTimestamped(t, task2, "task changed status queued -> canceled")
|
mocks.expectWriteTaskLogTimestamped(t, task2, "task changed status queued -> canceled")
|
||||||
mocks.expectBroadcastTaskChange(task2, api.TaskStatusQueued, api.TaskStatusCanceled)
|
mocks.expectBroadcastTaskChange(task2, api.TaskStatusQueued, api.TaskStatusCanceled)
|
||||||
mocks.persist.EXPECT().CountTasksOfJobInStatus(ctx, job,
|
mocks.persist.EXPECT().CountTasksOfJobInStatus(ctx, job,
|
||||||
api.TaskStatusActive, api.TaskStatusQueued, api.TaskStatusSoftFailed, api.TaskStatusPaused).
|
api.TaskStatusActive, api.TaskStatusQueued, api.TaskStatusSoftFailed).
|
||||||
Return(0, 2, nil)
|
Return(0, 2, nil)
|
||||||
mocks.expectSaveJobWithStatus(t, job, api.JobStatusCanceled)
|
mocks.expectSaveJobWithStatus(t, job, api.JobStatusCanceled)
|
||||||
mocks.expectBroadcastJobChange(task.Job, api.JobStatusCancelRequested, api.JobStatusCanceled)
|
mocks.expectBroadcastJobChange(task.Job, api.JobStatusCancelRequested, api.JobStatusCanceled)
|
||||||
|
Loading…
Reference in New Issue
Block a user