Commit 4aefe9c
[Security Solution][Cypress] Fix flaky related integrations test caused 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>1 parent 18e2c4f commit 4aefe9c
1 file changed
Lines changed: 25 additions & 17 deletions
File tree
- x-pack/solutions/security/test/security_solution_cypress/cypress/tasks/api_calls
Lines changed: 25 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
60 | 79 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
76 | 85 | | |
77 | | - | |
78 | 86 | | |
79 | 87 | | |
80 | 88 | | |
| |||
0 commit comments