Skip to content

Commit

Permalink
Log the event logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecote committed Oct 28, 2024
1 parent 1123b9e commit 8eba65f
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -732,18 +732,24 @@ export default function createAlertsAsDataFlappingTest({ getService }: FtrProvid
expect(response.status).to.eql(204);
});

await waitForEventLogDocs(ruleId, new Map([['execute', { equal: ++run }]]));
const eventLogs = await waitForEventLogDocs(
ruleId,
new Map([['execute', { equal: ++run }]])
);

const alertDocs = await queryForAlertDocs<PatternFiringAlert>(ruleId);
const isFlapping = alertDocs[0]._source![ALERT_FLAPPING];

log.debug(`Alert docs for i=${i}: ${JSON.stringify(alertDocs)}`);
log.debug(`Alert docs for run=${run}: ${JSON.stringify(alertDocs)}`);
log.debug(`Event log docs for run=${run}: ${JSON.stringify(eventLogs)}`);

if (!runWhichItFlapped && isFlapping) {
runWhichItFlapped = run;
}

log.debug(`runWhichItFlapped for i=${i}, isFlapping=${isFlapping}: ${runWhichItFlapped}`);
log.debug(
`runWhichItFlapped for run=${run}, isFlapping=${isFlapping}: ${runWhichItFlapped}`
);
}

// Never flapped, since globl flapping is off
Expand Down

0 comments on commit 8eba65f

Please sign in to comment.