diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts b/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts index 14c4c88fbb567..23bd53e69f492 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts @@ -395,18 +395,23 @@ describe('Task Runner Cancel', () => { await promise; const logger = taskRunnerFactoryInitializerParams.logger; - expect(logger.debug).toHaveBeenCalledTimes(4); + expect(logger.debug).toHaveBeenCalledTimes(6); expect(logger.debug).nthCalledWith(1, 'executing alert test:1 at 1970-01-01T00:00:00.000Z'); + expect(logger.debug).nthCalledWith(2, `Cancelling rule type test with id 1`); expect(logger.debug).nthCalledWith( - 2, + 3, + `Updating rule task for test rule with id 1 - execution error due to timeout` + ); + expect(logger.debug).nthCalledWith( + 4, `alert test:1: 'rule-name' has 1 active alert instances: [{\"instanceId\":\"1\",\"actionGroup\":\"default\"}]` ); expect(logger.debug).nthCalledWith( - 3, + 5, `no scheduling of actions for alert test:1: 'rule-name': alert execution has been cancelled.` ); expect(logger.debug).nthCalledWith( - 4, + 6, 'alertExecutionStatus for test:1: {"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"active"}' ); @@ -507,14 +512,19 @@ describe('Task Runner Cancel', () => { function testActionsExecute() { const logger = taskRunnerFactoryInitializerParams.logger; - expect(logger.debug).toHaveBeenCalledTimes(3); + expect(logger.debug).toHaveBeenCalledTimes(5); expect(logger.debug).nthCalledWith(1, 'executing alert test:1 at 1970-01-01T00:00:00.000Z'); + expect(logger.debug).nthCalledWith(2, `Cancelling rule type test with id 1`); expect(logger.debug).nthCalledWith( - 2, + 3, + `Updating rule task for test rule with id 1 - execution error due to timeout` + ); + expect(logger.debug).nthCalledWith( + 4, `alert test:1: 'rule-name' has 1 active alert instances: [{\"instanceId\":\"1\",\"actionGroup\":\"default\"}]` ); expect(logger.debug).nthCalledWith( - 3, + 5, 'alertExecutionStatus for test:1: {"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"active"}' );