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

[Alerting] Fixing Failing test: X-Pack Alerting API Integration Tests.x-pack/test/alerting_api_integration/security_and_spaces/tests/alerting/rbac_legacy·ts - alerting api integration security and spaces enabled Alerts legacy alerts alerts superuser at space1 should schedule actions on legacy alerts #92549

Merged
merged 17 commits into from
Feb 24, 2021

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Feb 24, 2021

Resolves #86952

Summary

This test was flaky due to a race condition when loading legacy alerts and task manager tasks from es archiver and migrating them. When the task manager tasks have finished migrating, task manager starts running them right away. If the kibana index was mid-migration, the task manager would try to look up an alert and get this error Saved object index alias [.kibana_8.0.0] not found: index_not_found_exception. This error would cause the task to set status to failed and not try to rerun the alert, which means downstream tests that depend on the alert executing would then fail.

I am mitigating this issue by resetting the task status to idle, meaning the task manager would be able to continue picking up this task.

Verified with Rudolph that this is a limitation of the functional tests and this should not happen in Kibana since task manager does not start polling until after all plugin setup (when migrations are run) are complete.

Successful flaky test runs:

Checklist

Delete any items that are not applicable to this PR.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@ymao1 ymao1 self-assigned this Feb 24, 2021
@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) v7.13.0 v8.0.0 labels Feb 24, 2021
@ymao1 ymao1 marked this pull request as ready for review February 24, 2021 12:59
@ymao1 ymao1 requested a review from a team as a code owner February 24, 2021 12:59
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

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.

Code LGTM! We'll be able to remove these legacy tests with #90386 relatively soon :-)

Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

LGTM

@ymao1 ymao1 added the auto-backport Deprecated: Automatically backport this PR after it's merged label Feb 24, 2021
@ymao1 ymao1 merged commit b303c9d into elastic:master Feb 24, 2021
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 24, 2021
….x-pack/test/alerting_api_integration/security_and_spaces/tests/alerting/rbac_legacy·ts - alerting api integration security and spaces enabled Alerts legacy alerts alerts superuser at space1 should schedule actions on legacy alerts (elastic#92549)

* Unskipping test

* Increasing runAt time

* Increasing runAt time

* Logging

* Increasing wait time even more

* Removing logs

* Resetting task status

* Re-enabling all tests

* Re-enabling all tests

* Adding comment
@kibanamachine
Copy link
Contributor

💚 Backport successful

7.x / #92690

Successful backport PRs will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Feb 24, 2021
….x-pack/test/alerting_api_integration/security_and_spaces/tests/alerting/rbac_legacy·ts - alerting api integration security and spaces enabled Alerts legacy alerts alerts superuser at space1 should schedule actions on legacy alerts (#92549) (#92690)

* Unskipping test

* Increasing runAt time

* Increasing runAt time

* Logging

* Increasing wait time even more

* Removing logs

* Resetting task status

* Re-enabling all tests

* Re-enabling all tests

* Adding comment

Co-authored-by: ymao1 <ying.mao@elastic.co>
@ymao1 ymao1 deleted the flaky-test-legacy-alert branch March 25, 2021 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated: Automatically backport this PR after it's merged 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) v7.13.0 v8.0.0
Projects
None yet
5 participants