refactor(core): Make PruningService.init and WaitTracker.init consistent (no-changelog) (#9761)
This commit is contained in:
@@ -34,7 +34,8 @@ describe('WaitTracker', () => {
|
||||
});
|
||||
|
||||
describe('init()', () => {
|
||||
it('should query DB for waiting executions', async () => {
|
||||
it('should query DB for waiting executions if leader', async () => {
|
||||
jest.spyOn(orchestrationService, 'isLeader', 'get').mockReturnValue(true);
|
||||
executionRepository.getWaitingExecutions.mockResolvedValue([execution]);
|
||||
|
||||
waitTracker.init();
|
||||
@@ -42,6 +43,14 @@ describe('WaitTracker', () => {
|
||||
expect(executionRepository.getWaitingExecutions).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('if follower, should do nothing', () => {
|
||||
executionRepository.getWaitingExecutions.mockResolvedValue([]);
|
||||
|
||||
waitTracker.init();
|
||||
|
||||
expect(executionRepository.findSingleExecution).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('if no executions to start, should do nothing', () => {
|
||||
executionRepository.getWaitingExecutions.mockResolvedValue([]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user