Skip to content

Commit

Permalink
fixed tests and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
YulNaumenko committed Oct 5, 2021
1 parent d062a21 commit b0b6d10
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/settings/alert-action-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ For example, `20m`, `24h`, `7d`, `1w`. Default: `60s`.
Sets the number of actions that will be executed ephemerally. To use this, enable ephemeral tasks in task manager first with <<task-manager-settings,`xpack.task_manager.ephemeral_tasks.enabled`>>

`xpack.alerting.defaultRuleTaskTimeout`::
Specifies the default timeout for the all rule types tasks. Task timeout could be overridden by the rule type producer during registration. The time is formatted as:
Specifies the default timeout for the all rule types tasks. The time is formatted as:
+
`<count>[ms,s,m,h,d,w,M,Y]`
+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ kibana_vars=(
xpack.alerting.healthCheck.interval
xpack.alerting.invalidateApiKeysTask.interval
xpack.alerting.invalidateApiKeysTask.removalDelay
xpack.alerting.defaultRuleTaskTimeout
xpack.alerts.healthCheck.interval
xpack.alerts.invalidateApiKeysTask.interval
xpack.alerts.invalidateApiKeysTask.removalDelay
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/alerting/server/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('config validation', () => {
const config: Record<string, unknown> = {};
expect(configSchema.validate(config)).toMatchInlineSnapshot(`
Object {
"defaultRuleTaskTimeout": "10m",
"defaultRuleTaskTimeout": "5m",
"healthCheck": Object {
"interval": "60m",
},
Expand Down
17 changes: 9 additions & 8 deletions x-pack/plugins/alerting/server/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Alerting Plugin', () => {
removalDelay: '1h',
},
maxEphemeralActionsPerAlert: 10,
defaultRuleTaskTimeout: '20m',
defaultRuleTaskTimeout: '5m',
});
plugin = new AlertingPlugin(context);

Expand Down Expand Up @@ -72,7 +72,7 @@ describe('Alerting Plugin', () => {
removalDelay: '1h',
},
maxEphemeralActionsPerAlert: 10,
defaultRuleTaskTimeout: '20m',
defaultRuleTaskTimeout: '5m',
});
plugin = new AlertingPlugin(context);

Expand Down Expand Up @@ -146,11 +146,12 @@ describe('Alerting Plugin', () => {
});

it('should apply default config value for ruleTaskTimeout', async () => {
setup.registerType({
const ruleType = {
...sampleAlertType,
minimumLicenseRequired: 'basic',
});
expect(sampleAlertType.ruleTaskTimeout).toBe('5m');
} as AlertType<never, never, never, never, never, "default", never>;
await setup.registerType(ruleType);
expect(ruleType.ruleTaskTimeout).toBe('5m');
});
});
});
Expand All @@ -167,7 +168,7 @@ describe('Alerting Plugin', () => {
removalDelay: '1h',
},
maxEphemeralActionsPerAlert: 10,
defaultRuleTaskTimeout: '20m',
defaultRuleTaskTimeout: '5m',
});
const plugin = new AlertingPlugin(context);

Expand Down Expand Up @@ -208,7 +209,7 @@ describe('Alerting Plugin', () => {
removalDelay: '1h',
},
maxEphemeralActionsPerAlert: 10,
defaultRuleTaskTimeout: '20m',
defaultRuleTaskTimeout: '5m',
});
const plugin = new AlertingPlugin(context);

Expand Down Expand Up @@ -263,7 +264,7 @@ describe('Alerting Plugin', () => {
removalDelay: '1h',
},
maxEphemeralActionsPerAlert: 100,
defaultRuleTaskTimeout: '20m',
defaultRuleTaskTimeout: '5m',
});
const plugin = new AlertingPlugin(context);

Expand Down

0 comments on commit b0b6d10

Please sign in to comment.