Skip to content

Commit

Permalink
Test notifications on rule timeout (revert this)
Browse files Browse the repository at this point in the history
  • Loading branch information
madirey committed Mar 22, 2022
1 parent dc4d64b commit 0c49fc4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const createSecurityRuleTypeWrapper: CreateSecurityRuleTypeWrapper =
const persistenceRuleType = createPersistenceRuleTypeWrapper({ ruleDataClient, logger });
return persistenceRuleType({
...type,
ruleTaskTimeout: '10s',
cancelAlertsOnRuleTimeout: false,
useSavedObjectReferences: {
extractReferences: (params) => extractReferences({ logger, params }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ export const searchAfterAndBulkCreate = async ({
if (hasSortId) {
const { searchResult, searchDuration, searchErrors } = await singleSearchAfter({
buildRuleMessage,
// time out after 2 signals created
aggregations:
signalsCreatedCount > 0
? {
delay: {
shard_delay: {
value: '30s',
},
},
}
: {},
searchAfterSortIds: sortIds,
index: inputIndexPattern,
from: tuple.from.toISOString(),
Expand All @@ -78,7 +89,8 @@ export const searchAfterAndBulkCreate = async ({
logger,
// @ts-expect-error please, declare a type explicitly instead of unknown
filter,
pageSize: Math.ceil(Math.min(tuple.maxSignals, pageSize)),
// pageSize: Math.ceil(Math.min(tuple.maxSignals, pageSize)),
pageSize: 2,
timestampOverride: ruleParams.timestampOverride,
trackTotalHits,
sortOrder,
Expand Down

0 comments on commit 0c49fc4

Please sign in to comment.