-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RAM] fixes flaky tests for alerting bulk_edit HTTP API, adds additio…
…nal tests for alerting bulk_edit (#133635) ## Summary Addresses #132195 Follow-up to #132637 - Fixes flaky tests `x-pack/test/alerting_api_integration/spaces_only/tests/alerting/bulk_edit.ts` - Adds new tests in spaces_only/tests/alerting/bulk_edit.ts for the following operations: `schedule`, `notifyWhen`, `throttle` - Adds units test in x-pack/plugins/alerting/server/rules_client/lib/apply_bulk_edit_operation.test.ts ### Details to fixing flaky tests Despite having bulkEdit retry when 409 conflict happens during bulk update of SO, sometimes there was still failing test. So, all tests in bulk_edit.ts were skipped 93ffd78 The reason, it happens I believe because mocked rule that used for test is enabled, its update after run clashes with `SavedObject.bulkUpdate` method that used inside `RulesClient.bulkEdit`. So, to fix it, I made this mocked rule disabled, which seems like fixed the flakiness Here is flaky test runner builds with ENABLED rule: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/717 https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/713 and with DISABLED: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/718 https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/714 In both enabled runs there was test failure, but not for disabled. Another possible way to fix: use retry in test for `rules.bulkEdit` call and assertion. Let me know if it can more preferable way to fix it ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
- Loading branch information
Showing
2 changed files
with
192 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters