Skip to content

[8.19] [Security Solution][Cypress] Fix flaky related integrations test caused by Fleet race condition (#261128)#262481

Open
kibanamachine wants to merge 1 commit intoelastic:8.19from
kibanamachine:backport/8.19/pr-261128
Open

[8.19] [Security Solution][Cypress] Fix flaky related integrations test caused by Fleet race condition (#261128)#262481
kibanamachine wants to merge 1 commit intoelastic:8.19from
kibanamachine:backport/8.19/pr-261128

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

…ed by Fleet race condition (elastic#261128)

**Resolves: elastic#259831
**Resolves: elastic#239356

## Summary

Mitigates chances of `related_integrations.cy.ts` failure by reducing
pressure on Kibana's Fleet plugin via adding extra waiting for
integrations installation before adding agent policies. Generally this
mitigates the risk of failure.

## Details

Mitigates `related_integrations.cy.ts` flakiness reasons in the suite
where `cy.request()` timed out waiting for `POST
/api/fleet/agent_policies?sys_monitoring=true`.

**Root cause**: `installIntegrations()` fired the bulk package install
request and immediately followed with the agent policy creation request.
The Fleet bulk install endpoint returns a response once the request is
accepted, but processes package assets asynchronously. Under CI load,
Fleet was still indexing large packages (`aws`, `system`) when the agent
policy POST arrived, causing the API to become unresponsive and exceed
the 30s default timeout.

**Fix**:
- Chain the agent policy creation inside `.then()` after the bulk
install, polling `waitForPackageInstalled` for each package before
proceeding.
- Increase the agent policy creation timeout from 30s to 60s, as this
endpoint is inherently slow with `?sys_monitoring=true`.

## Flaky test runner

TBD

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 4aefe9c)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Apr 10, 2026
@kibanamachine kibanamachine enabled auto-merge (squash) April 10, 2026 10:31
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Apr 10, 2026

💔 Build Failed

Failed CI Steps

Metrics [docs]

✅ unchanged

History

cc @maximpn

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