[8.12] Fixes Failing test: X-Pack Alerting API Integration Tests.x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/alerting_and_actions_telemetry·ts - alerting api integration security and spaces enabled - Grou (#172895)

# Backport

This will backport the following commits from `main` to `8.12`:
- [Fixes Failing test: X-Pack Alerting API Integration
Tests.x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/alerting_and_actions_telemetry·ts
- alerting api integration security and spaces enabled - Group 2
Alerting and Actions Telemetry telemetry should retrieve telemetry data
in the expected format
(#172701)](https://github.com/elastic/kibana/pull/172701)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Ying
Mao","email":"ying.mao@elastic.co"},"sourceCommit":{"committedDate":"2023-12-07T21:43:49Z","message":"Fixes
Failing test: X-Pack Alerting API Integration
Tests.x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/alerting_and_actions_telemetry·ts
- alerting api integration security and spaces enabled - Group 2
Alerting and Actions Telemetry telemetry should retrieve telemetry data
in the expected format (#172701)\n\n## Summary\r\n\r\nTest was failing
because a `avg_execution_time > 0` check in the\r\ntelemetry was
returning `false` instead of `true`. I added a short delay\r\nto the
connector executor to increase the execution time duration\r\nslightly
to try to avoid this.\r\n\r\nRan 450x in the flaky test
runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4256\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"ef87bceeab3b5b8837d14147956b97c6c19c6678","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Alerting","release_note:skip","Team:ResponseOps","v8.12.0","v8.13.0"],"number":172701,"url":"https://github.com/elastic/kibana/pull/172701","mergeCommit":{"message":"Fixes
Failing test: X-Pack Alerting API Integration
Tests.x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/alerting_and_actions_telemetry·ts
- alerting api integration security and spaces enabled - Group 2
Alerting and Actions Telemetry telemetry should retrieve telemetry data
in the expected format (#172701)\n\n## Summary\r\n\r\nTest was failing
because a `avg_execution_time > 0` check in the\r\ntelemetry was
returning `false` instead of `true`. I added a short delay\r\nto the
connector executor to increase the execution time duration\r\nslightly
to try to avoid this.\r\n\r\nRan 450x in the flaky test
runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4256\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"ef87bceeab3b5b8837d14147956b97c6c19c6678"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/172701","number":172701,"mergeCommit":{"message":"Fixes
Failing test: X-Pack Alerting API Integration
Tests.x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/alerting_and_actions_telemetry·ts
- alerting api integration security and spaces enabled - Group 2
Alerting and Actions Telemetry telemetry should retrieve telemetry data
in the expected format (#172701)\n\n## Summary\r\n\r\nTest was failing
because a `avg_execution_time > 0` check in the\r\ntelemetry was
returning `false` instead of `true`. I added a short delay\r\nto the
connector executor to increase the execution time duration\r\nslightly
to try to avoid this.\r\n\r\nRan 450x in the flaky test
runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4256\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"ef87bceeab3b5b8837d14147956b97c6c19c6678"}}]}]
BACKPORT-->

Co-authored-by: Ying Mao <ying.mao@elastic.co>
This commit is contained in:
Kibana Machine 2023-12-07 17:43:26 -05:00 committed by GitHub
parent f0cdb00ee4
commit e184ffa399
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -45,6 +45,8 @@ export function defineActionTypes(
params: { schema: schema.object({}, { defaultValue: {} }) },
},
async executor() {
// add a delay so the execution time is non-zero
await new Promise((r) => setTimeout(r, 1000));
throw new Error('this action is intended to fail');
},
};

View file

@ -26,8 +26,7 @@ export default function createAlertingAndActionsTelemetryTests({ getService }: F
const esTestIndexTool = new ESTestIndexTool(es, retry);
const supertestWithoutAuth = getService('supertestWithoutAuth');
// FLAKY: https://github.com/elastic/kibana/issues/140973
describe.skip('telemetry', () => {
describe('test telemetry', () => {
const objectRemover = new ObjectRemover(supertest);
const alwaysFiringRuleId: { [key: string]: string } = {};