Skip to content

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 9.0:

Questions ?

Please refer to the Backport tool documentation

…nagement integration tests (elastic#230338)

**Resolves: elastic#228844
**Resolves: elastic#229297
**Relates to: elastic#230363

## Summary

This PR fixes integration tests flakiness caused by a race condition with the Fleet setup logic.

## Details

Investigation of the related flaky integration tests has revealed that Fleet's setup logic (usually executed upon Kibana startup) performs installed packages re-installation. However, Fleet allows to make API calls like install a package. Subsequently some package (for example `security_detection_engine`) might be installed before Fleet's setup logic completed. In particular a package installation API call leads to creation of package installation SO which is read by Fleet's setup logic. So Fleet "thinks" the package was installed some time ago and required re-installation.

There is a Fleet bug ticket describing this issue.

This fix in this PR just wait for Fleet plugin to finish setup before running integration tests for Rule Management area.

## Flaky test runner

- ✅ [200 runs](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8999)

(cherry picked from commit 2250c52)
@kibanamachine kibanamachine merged commit 09459ea into elastic:9.0 Aug 4, 2025
12 checks passed
maximpn added a commit that referenced this pull request Aug 5, 2025
…ule Management integration tests (#230338) (#230573)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Security Solution] Wait for Fleet plugin setup completion in Rule
Management integration tests
(#230338)](#230338)

<!--- Backport version: 10.0.1 -->

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

<!--BACKPORT [{"author":{"name":"Maxim
Palenov","email":"maxim.palenov@elastic.co"},"sourceCommit":{"committedDate":"2025-08-04T12:27:19Z","message":"[Security
Solution] Wait for Fleet plugin setup completion in Rule Management
integration tests (#230338)\n\n**Resolves:
https://github.com/elastic/kibana/issues/228844**\n**Resolves:
https://github.com/elastic/kibana/issues/229297**\n**Relates to:
https://github.com/elastic/kibana/issues/230363**\n\n## Summary\n\nThis
PR fixes integration tests flakiness caused by a race condition with the
Fleet setup logic.\n\n## Details\n\nInvestigation of the related flaky
integration tests has revealed that Fleet's setup logic (usually
executed upon Kibana startup) performs installed packages
re-installation. However, Fleet allows to make API calls like install a
package. Subsequently some package (for example
`security_detection_engine`) might be installed before Fleet's setup
logic completed. In particular a package installation API call leads to
creation of package installation SO which is read by Fleet's setup
logic. So Fleet \"thinks\" the package was installed some time ago and
required re-installation.\n\nThere is a Fleet bug ticket describing this
issue.\n\nThis fix in this PR just wait for Fleet plugin to finish setup
before running integration tests for Rule Management area.\n\n## Flaky
test runner\n\n- ✅ [200
runs](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8999)","sha":"2250c52fa0b5fb0e5c923cc5643f10de4e9fa357","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","release_note:skip","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v9.2.0","v9.0.5","v9.1.1","v8.18.5","v8.19.1"],"title":"[Security
Solution] Wait for Fleet plugin setup completion in Rule Management
integration
tests","number":230338,"url":"https://github.com/elastic/kibana/pull/230338","mergeCommit":{"message":"[Security
Solution] Wait for Fleet plugin setup completion in Rule Management
integration tests (#230338)\n\n**Resolves:
https://github.com/elastic/kibana/issues/228844**\n**Resolves:
https://github.com/elastic/kibana/issues/229297**\n**Relates to:
https://github.com/elastic/kibana/issues/230363**\n\n## Summary\n\nThis
PR fixes integration tests flakiness caused by a race condition with the
Fleet setup logic.\n\n## Details\n\nInvestigation of the related flaky
integration tests has revealed that Fleet's setup logic (usually
executed upon Kibana startup) performs installed packages
re-installation. However, Fleet allows to make API calls like install a
package. Subsequently some package (for example
`security_detection_engine`) might be installed before Fleet's setup
logic completed. In particular a package installation API call leads to
creation of package installation SO which is read by Fleet's setup
logic. So Fleet \"thinks\" the package was installed some time ago and
required re-installation.\n\nThere is a Fleet bug ticket describing this
issue.\n\nThis fix in this PR just wait for Fleet plugin to finish setup
before running integration tests for Rule Management area.\n\n## Flaky
test runner\n\n- ✅ [200
runs](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8999)","sha":"2250c52fa0b5fb0e5c923cc5643f10de4e9fa357"}},"sourceBranch":"main","suggestedTargetBranches":["9.1"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/230338","number":230338,"mergeCommit":{"message":"[Security
Solution] Wait for Fleet plugin setup completion in Rule Management
integration tests (#230338)\n\n**Resolves:
https://github.com/elastic/kibana/issues/228844**\n**Resolves:
https://github.com/elastic/kibana/issues/229297**\n**Relates to:
https://github.com/elastic/kibana/issues/230363**\n\n## Summary\n\nThis
PR fixes integration tests flakiness caused by a race condition with the
Fleet setup logic.\n\n## Details\n\nInvestigation of the related flaky
integration tests has revealed that Fleet's setup logic (usually
executed upon Kibana startup) performs installed packages
re-installation. However, Fleet allows to make API calls like install a
package. Subsequently some package (for example
`security_detection_engine`) might be installed before Fleet's setup
logic completed. In particular a package installation API call leads to
creation of package installation SO which is read by Fleet's setup
logic. So Fleet \"thinks\" the package was installed some time ago and
required re-installation.\n\nThere is a Fleet bug ticket describing this
issue.\n\nThis fix in this PR just wait for Fleet plugin to finish setup
before running integration tests for Rule Management area.\n\n## Flaky
test runner\n\n- ✅ [200
runs](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8999)","sha":"2250c52fa0b5fb0e5c923cc5643f10de4e9fa357"}},{"branch":"9.0","label":"v9.0.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/230412","number":230412,"state":"MERGED","mergeCommit":{"sha":"09459eaf0a2e8e59c363e67387e535396922521f","message":"[9.0]
[Security Solution] Wait for Fleet plugin setup completion in Rule
Management integration tests (#230338) (#230412)\n\n# Backport\n\nThis
will backport the following commits from `main` to `9.0`:\n- [[Security
Solution] Wait for Fleet plugin setup completion in Rule\nManagement
integration
tests\n(#230338)](https://github.com/elastic/kibana/pull/230338)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Maxim Palenov
<maxim.palenov@elastic.co>"}},{"branch":"9.1","label":"v9.1.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/230410","number":230410,"state":"MERGED","mergeCommit":{"sha":"8b9a3e7b36e1c7e21434fc46a686c511d29afc4f","message":"[8.18]
[Security Solution] Wait for Fleet plugin setup completion in Rule
Management integration tests (#230338) (#230410)\n\n# Backport\n\nThis
will backport the following commits from `main` to `8.18`:\n- [[Security
Solution] Wait for Fleet plugin setup completion in Rule\nManagement
integration
tests\n(#230338)](https://github.com/elastic/kibana/pull/230338)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Maxim Palenov
<maxim.palenov@elastic.co>"}},{"branch":"8.19","label":"v8.19.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/230411","number":230411,"state":"MERGED","mergeCommit":{"sha":"d02d0445f542f69a3f6a92c0525df1340e30f63a","message":"[8.19]
[Security Solution] Wait for Fleet plugin setup completion in Rule
Management integration tests (#230338) (#230411)\n\n# Backport\n\nThis
will backport the following commits from `main` to `8.19`:\n- [[Security
Solution] Wait for Fleet plugin setup completion in Rule\nManagement
integration
tests\n(#230338)](https://github.com/elastic/kibana/pull/230338)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Maxim Palenov <maxim.palenov@elastic.co>"}}]}] BACKPORT-->
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.

2 participants