Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes flaky backfill tests. #198592

Merged
merged 1 commit into from
Nov 7, 2024
Merged

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Oct 31, 2024

Resolves #192144
Resolves #198168
Resolves #197239

Summary

Minor fixes to the backfill functional tests to try to reduce flakiness.

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#7317

[❌] x-pack/test/alerting_api_integration/security_and_spaces/group1/config.ts: 173/200 tests passed.

see run history

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#7319

[❌] x-pack/test/alerting_api_integration/security_and_spaces/group1/config.ts: 171/200 tests passed.

see run history

@ymao1 ymao1 force-pushed the flaky-test-192144-again branch from ad9868d to f0e94ce Compare November 1, 2024 19:41
@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#7320

[❌] x-pack/test/alerting_api_integration/security_and_spaces/group1/config.ts: 174/200 tests passed.

see run history

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#7322

[❌] x-pack/test/alerting_api_integration/security_and_spaces/group1/config.ts: 175/200 tests passed.

see run history

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#7326

[❌] x-pack/test/alerting_api_integration/security_and_spaces/group1/config.ts: 172/200 tests passed.

see run history

@ymao1 ymao1 force-pushed the flaky-test-192144-again branch from 639da5a to d8ac15a Compare November 4, 2024 20:50
@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#7327

[✅] x-pack/test/alerting_api_integration/security_and_spaces/group1/config.ts: 100/100 tests passed.

see run history

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#7328

[❌] x-pack/test/alerting_api_integration/security_and_spaces/group1/config.ts: 172/200 tests passed.

see run history

@ymao1 ymao1 changed the title Flaky test 192144 again Fixes Failing test: X-Pack Alerting API Integration Tests.x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/task_runner·ts - alerting api integration security and spaces enabled Alerts - Group 1 alerts backfill rule runs ad hoc backfill task should run all execution sets of a scheduled backfill and correctly generate alerts Nov 5, 2024
@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#7336

[❌] x-pack/test/alerting_api_integration/security_and_spaces/group1/config.ts: 170/200 tests passed.

see run history

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#7338

[✅] x-pack/test/alerting_api_integration/security_and_spaces/group1/config.ts: 200/200 tests passed.

see run history

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#7342

[❌] x-pack/test/alerting_api_integration/security_and_spaces/group1/config.ts: 173/200 tests passed.

see run history

@ymao1 ymao1 force-pushed the flaky-test-192144-again branch from e89908f to e2344f8 Compare November 6, 2024 19:08
@@ -263,11 +263,11 @@ export default function apiKeyBackfillTests({ getService }: FtrProviderContext)
}
});

// invoke the invalidate task
await runInvalidateTask();

// pending API key should now be deleted because backfill is done
await retry.try(async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like sometimes the last API key is not invalidated so moving this into the retry loop to retry to invalidate task as well.

@@ -759,7 +759,7 @@ export default function scheduleBackfillTests({ getService }: FtrProviderContext
});

it('should handle schedule request where some requests succeed and some requests fail appropriately', async () => {
const start = moment().utc().startOf('day').subtract(7, 'days').toISOString();
const start = moment().utc().startOf('day').subtract(14, 'days').toISOString();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

increasing the length of the backfill run because occasionally, checking AAD at the end of the this test would return a saved object not found error.

@@ -167,7 +166,7 @@ export default function createBackfillTaskRunnerTests({ getService }: FtrProvide
objectRemover.add(spaceId, ruleId, 'rule', 'alerting');

const start = moment(originalDocTimestamps[1]).utc().startOf('day').toISOString();
const end = moment().utc().startOf('day').subtract(9, 'days').toISOString();
const end = moment(originalDocTimestamps[11]).utc().startOf('day').toISOString();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixing the end timestamp so it relates to the doc timestamps and not to the current time.

@ymao1 ymao1 changed the title Fixes Failing test: X-Pack Alerting API Integration Tests.x-pack/test/alerting_api_integration/security_and_spaces/group1/tests/alerting/backfill/task_runner·ts - alerting api integration security and spaces enabled Alerts - Group 1 alerts backfill rule runs ad hoc backfill task should run all execution sets of a scheduled backfill and correctly generate alerts Fixes flaky backfill tests. Nov 6, 2024
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#7345

[❌] x-pack/test/alerting_api_integration/security_and_spaces/group1/config.ts: 173/200 tests passed.

see run history

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#7346

[✅] x-pack/test/alerting_api_integration/security_and_spaces/group1/config.ts: 200/200 tests passed.

see run history

@ymao1 ymao1 self-assigned this Nov 7, 2024
@ymao1 ymao1 added Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v9.0.0 backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) v8.17.0 labels Nov 7, 2024
@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#7347

[✅] x-pack/test/alerting_api_integration/security_and_spaces/group1/config.ts: 200/200 tests passed.

see run history

@ymao1 ymao1 marked this pull request as ready for review November 7, 2024 12:43
@ymao1 ymao1 requested a review from a team as a code owner November 7, 2024 12:43
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@ymao1 ymao1 requested review from pmuellr and adcoelho November 7, 2024 12:44
Copy link
Contributor

@mikecote mikecote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM!

@ymao1 ymao1 merged commit 705c503 into elastic:main Nov 7, 2024
33 checks passed
@ymao1 ymao1 deleted the flaky-test-192144-again branch November 7, 2024 12:49
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11723324993

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 7, 2024
Resolves elastic#192144
Resolves elastic#198168
Resolves elastic#197239

## Summary

Minor fixes to the backfill functional tests to try to reduce flakiness.

(cherry picked from commit 705c503)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 7, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [Fixes flaky backfill tests.
(#198592)](#198592)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Ying
Mao","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-07T12:49:36Z","message":"Fixes
flaky backfill tests. (#198592)\n\nResolves
https://github.com/elastic/kibana/issues/192144\r\nResolves
https://github.com/elastic/kibana/issues/198168\r\nResolves
https://github.com/elastic/kibana/issues/197239\r\n\r\n##
Summary\r\n\r\nMinor fixes to the backfill functional tests to try to
reduce
flakiness.","sha":"705c503182bce91aa8b717febe508ba29ca2d8c6","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Alerting","release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-minor","v8.17.0"],"title":"Fixes
flaky backfill
tests.","number":198592,"url":"https://github.com/elastic/kibana/pull/198592","mergeCommit":{"message":"Fixes
flaky backfill tests. (#198592)\n\nResolves
https://github.com/elastic/kibana/issues/192144\r\nResolves
https://github.com/elastic/kibana/issues/198168\r\nResolves
https://github.com/elastic/kibana/issues/197239\r\n\r\n##
Summary\r\n\r\nMinor fixes to the backfill functional tests to try to
reduce
flakiness.","sha":"705c503182bce91aa8b717febe508ba29ca2d8c6"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198592","number":198592,"mergeCommit":{"message":"Fixes
flaky backfill tests. (#198592)\n\nResolves
https://github.com/elastic/kibana/issues/192144\r\nResolves
https://github.com/elastic/kibana/issues/198168\r\nResolves
https://github.com/elastic/kibana/issues/197239\r\n\r\n##
Summary\r\n\r\nMinor fixes to the backfill functional tests to try to
reduce
flakiness.","sha":"705c503182bce91aa8b717febe508ba29ca2d8c6"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Ying Mao <[email protected]>
mbondyra pushed a commit to mbondyra/kibana that referenced this pull request Nov 8, 2024
Resolves elastic#192144
Resolves elastic#198168
Resolves elastic#197239

## Summary

Minor fixes to the backfill functional tests to try to reduce flakiness.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.17.0 v9.0.0
Projects
None yet
4 participants