diff --git a/packages/cli/src/executions/__tests__/execution.service.test.ts b/packages/cli/src/executions/__tests__/execution.service.test.ts index 7444ec61549fb..567e0c9758a6f 100644 --- a/packages/cli/src/executions/__tests__/execution.service.test.ts +++ b/packages/cli/src/executions/__tests__/execution.service.test.ts @@ -235,6 +235,7 @@ describe('ExecutionService', () => { * Assert */ expect(waitTracker.stopExecution).not.toHaveBeenCalled(); + expect(activeExecutions.stopExecution).toHaveBeenCalled(); expect(queue.findRunningJobBy).toBeCalledWith({ executionId: execution.id }); expect(queue.stopJob).toHaveBeenCalled(); expect(executionRepository.stopDuringRun).toHaveBeenCalled(); @@ -260,6 +261,7 @@ describe('ExecutionService', () => { * Assert */ expect(waitTracker.stopExecution).toHaveBeenCalledWith(execution.id); + expect(activeExecutions.stopExecution).toHaveBeenCalled(); expect(queue.findRunningJobBy).toBeCalledWith({ executionId: execution.id }); expect(queue.stopJob).toHaveBeenCalled(); expect(executionRepository.stopDuringRun).toHaveBeenCalled(); diff --git a/packages/cli/src/executions/execution.service.ts b/packages/cli/src/executions/execution.service.ts index 45d6faca35b68..853dbb64ff8ae 100644 --- a/packages/cli/src/executions/execution.service.ts +++ b/packages/cli/src/executions/execution.service.ts @@ -460,6 +460,10 @@ export class ExecutionService { return await this.stopInRegularMode(execution); } + if (this.activeExecutions.has(execution.id)) { + await this.activeExecutions.stopExecution(execution.id); + } + if (this.waitTracker.has(execution.id)) { await this.waitTracker.stopExecution(execution.id); }