Skip to content

Commit

Permalink
fix cloud/tasks/tests/tests.TestTryExecutingTask (#2158)
Browse files Browse the repository at this point in the history
  • Loading branch information
SvartMetal authored Sep 27, 2024
1 parent bb2b5cd commit 5daeba1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cloud/tasks/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1261,8 +1261,7 @@ func TestTryExecutingTask(t *testing.T) {
runner.On("lockTask", ctx, taskInfo).Return(state, nil)
task.On("Load", state.Request, state.State).Return(nil)
taskStorage.On("UpdateTask", mock.Anything, mock.MatchedBy(matchesState(t, state))).Return(state, nil).Maybe()
execCtx := newExecutionContext(task, taskStorage, state, time.Hour, 2)
runnerMetrics.On("OnExecutionStarted", execCtx)
runnerMetrics.On("OnExecutionStarted", mock.Anything)
runner.On("executeTask", mock.Anything, mock.Anything, task)
runnerMetrics.On("OnExecutionStopped")

Expand Down Expand Up @@ -1317,8 +1316,7 @@ func TestTryExecutingTaskFailToPing(t *testing.T) {
updateTaskErr,
).Once()

execCtx := newExecutionContext(task, taskStorage, state, time.Hour, 2)
runnerMetrics.On("OnExecutionStarted", execCtx)
runnerMetrics.On("OnExecutionStarted", mock.Anything)
runner.On("executeTask", mock.Anything, mock.Anything, task).Run(func(args mock.Arguments) {
// Wait for pingPeriod, so that the first ping has had a chance to run.
// TODO: This is bad.
Expand Down

0 comments on commit 5daeba1

Please sign in to comment.