Skip to content

[9.0] [Security Solution] Fix real prebuilt rules package related flakiness in integration tests (#227689)#228778

Merged
kibanamachine merged 2 commits intoelastic:9.0from
kibanamachine:backport/9.0/pr-227689
Jul 22, 2025
Merged

[9.0] [Security Solution] Fix real prebuilt rules package related flakiness in integration tests (#227689)#228778
kibanamachine merged 2 commits intoelastic:9.0from
kibanamachine:backport/9.0/pr-227689

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.0:

Questions ?

Please refer to the Backport tool documentation

… in integration tests (elastic#227689)

**Resolves: elastic#220333
**Resolves: elastic#227571
**Resolves: elastic#219407

## Summary

This PR fixes flakiness caused by the real prebuilt rules package installation.

## Details

Multiple Rule Management API endpoints install the prebuilt rules package under the hood when it's not installed. In normal case this installation happens from the EPR. The problem is that EPR might be unavailable for some period of time or there network issues blocking EPR access. On top of that real package is heavy and requires some time and resources to be installed. While the major part of our functionality doesn't depend on the real prebuilt rules package and the concrete rules there. On top of that API endpoints depending on the real prebuilt rules package fail with HTTP 500 error when EPR is unavailable.

This PR extends the Functional Test Runner with `rootHooks.beforeAll` configuration option which is used to install a lightweight mock prebuilt rules package. This action prevents real package installation make the tests much more predictable.

## Flaky test runner

- ✅ [ECH import custom rules integration tests (200 runs)](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8627)
- ✅ [Serverless import custom rules integration tests (200 runs)](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8642)

(cherry picked from commit 76908c5)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Jul 21, 2025
@kibanamachine kibanamachine enabled auto-merge (squash) July 21, 2025 12:49
@kibanamachine kibanamachine merged commit 34e9bce into elastic:9.0 Jul 22, 2025
9 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants