
Tasks that are in state `active` but haven't been 'touched' by a Worker for 10 minutes or longer will transition to state `failed`. In the future, it might be better to move the decision about which state is suitable to the Task State Machine service, so that it can be smarter and take the history of the task into account. Going to `soft-failed` first might be a nice touch.
129 lines
4.6 KiB
Go
129 lines
4.6 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: git.blender.org/flamenco/internal/manager/timeout_checker (interfaces: PersistenceService,TaskStateMachine,LogStorage)
|
|
|
|
// Package mocks is a generated GoMock package.
|
|
package mocks
|
|
|
|
import (
|
|
context "context"
|
|
reflect "reflect"
|
|
time "time"
|
|
|
|
persistence "git.blender.org/flamenco/internal/manager/persistence"
|
|
api "git.blender.org/flamenco/pkg/api"
|
|
gomock "github.com/golang/mock/gomock"
|
|
zerolog "github.com/rs/zerolog"
|
|
)
|
|
|
|
// MockPersistenceService is a mock of PersistenceService interface.
|
|
type MockPersistenceService struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockPersistenceServiceMockRecorder
|
|
}
|
|
|
|
// MockPersistenceServiceMockRecorder is the mock recorder for MockPersistenceService.
|
|
type MockPersistenceServiceMockRecorder struct {
|
|
mock *MockPersistenceService
|
|
}
|
|
|
|
// NewMockPersistenceService creates a new mock instance.
|
|
func NewMockPersistenceService(ctrl *gomock.Controller) *MockPersistenceService {
|
|
mock := &MockPersistenceService{ctrl: ctrl}
|
|
mock.recorder = &MockPersistenceServiceMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockPersistenceService) EXPECT() *MockPersistenceServiceMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// FetchTimedOutTasks mocks base method.
|
|
func (m *MockPersistenceService) FetchTimedOutTasks(arg0 context.Context, arg1 time.Time) ([]*persistence.Task, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "FetchTimedOutTasks", arg0, arg1)
|
|
ret0, _ := ret[0].([]*persistence.Task)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// FetchTimedOutTasks indicates an expected call of FetchTimedOutTasks.
|
|
func (mr *MockPersistenceServiceMockRecorder) FetchTimedOutTasks(arg0, arg1 interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchTimedOutTasks", reflect.TypeOf((*MockPersistenceService)(nil).FetchTimedOutTasks), arg0, arg1)
|
|
}
|
|
|
|
// MockTaskStateMachine is a mock of TaskStateMachine interface.
|
|
type MockTaskStateMachine struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockTaskStateMachineMockRecorder
|
|
}
|
|
|
|
// MockTaskStateMachineMockRecorder is the mock recorder for MockTaskStateMachine.
|
|
type MockTaskStateMachineMockRecorder struct {
|
|
mock *MockTaskStateMachine
|
|
}
|
|
|
|
// NewMockTaskStateMachine creates a new mock instance.
|
|
func NewMockTaskStateMachine(ctrl *gomock.Controller) *MockTaskStateMachine {
|
|
mock := &MockTaskStateMachine{ctrl: ctrl}
|
|
mock.recorder = &MockTaskStateMachineMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockTaskStateMachine) EXPECT() *MockTaskStateMachineMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// TaskStatusChange mocks base method.
|
|
func (m *MockTaskStateMachine) TaskStatusChange(arg0 context.Context, arg1 *persistence.Task, arg2 api.TaskStatus) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "TaskStatusChange", arg0, arg1, arg2)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// TaskStatusChange indicates an expected call of TaskStatusChange.
|
|
func (mr *MockTaskStateMachineMockRecorder) TaskStatusChange(arg0, arg1, arg2 interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TaskStatusChange", reflect.TypeOf((*MockTaskStateMachine)(nil).TaskStatusChange), arg0, arg1, arg2)
|
|
}
|
|
|
|
// MockLogStorage is a mock of LogStorage interface.
|
|
type MockLogStorage struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockLogStorageMockRecorder
|
|
}
|
|
|
|
// MockLogStorageMockRecorder is the mock recorder for MockLogStorage.
|
|
type MockLogStorageMockRecorder struct {
|
|
mock *MockLogStorage
|
|
}
|
|
|
|
// NewMockLogStorage creates a new mock instance.
|
|
func NewMockLogStorage(ctrl *gomock.Controller) *MockLogStorage {
|
|
mock := &MockLogStorage{ctrl: ctrl}
|
|
mock.recorder = &MockLogStorageMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockLogStorage) EXPECT() *MockLogStorageMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// WriteTimestamped mocks base method.
|
|
func (m *MockLogStorage) WriteTimestamped(arg0 zerolog.Logger, arg1, arg2, arg3 string) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "WriteTimestamped", arg0, arg1, arg2, arg3)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// WriteTimestamped indicates an expected call of WriteTimestamped.
|
|
func (mr *MockLogStorageMockRecorder) WriteTimestamped(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteTimestamped", reflect.TypeOf((*MockLogStorage)(nil).WriteTimestamped), arg0, arg1, arg2, arg3)
|
|
}
|