Skip to content

[EA] Fix flaky entities_table_grouping: extend @entityStoreSearch timeout#268217

Merged
MadameSheema merged 6 commits intoelastic:mainfrom
MadameSheema:ea/flaky-test
May 7, 2026
Merged

[EA] Fix flaky entities_table_grouping: extend @entityStoreSearch timeout#268217
MadameSheema merged 6 commits intoelastic:mainfrom
MadameSheema:ea/flaky-test

Conversation

@MadameSheema
Copy link
Copy Markdown
Contributor

@MadameSheema MadameSheema commented May 7, 2026

Summary

Fixes intermittent failures in entities_table_grouping.cy.ts reported in:

Root Cause

PR #265125 added interceptEntityStoreStatus('running') + cy.wait('@entityStoreStatus', { timeout: 20000 }) to every beforeEach to prevent the page from showing EntityStoreDisabledEmptyPrompt. The intent was correct, but after @entityStoreStatus resolves, the page still needs to:

  1. React re-render with the new status data
  2. Wait for isSourcererLoading = false (the sourcerer / data-view initialization)
  3. Mount EntitiesTableSection
  4. Fire the POST to /internal/search/ese

This cascade can easily take > 5 s in slow CI environments, while cy.wait('@entityStoreSearch') was left with the default 5 s timeout — causing "No request ever occurred" failures.

Changes

Option A — raise the @entityStoreSearch timeout to 20 s, matching @entityStoreStatus.

Option B — consolidate cy.wait('@entityStoreStatus') + cy.wait('@entityStoreSearch') + waitForGroupingTable() into a single waitForEntityAnalyticsPageReady() task helper, so the three beforeEach blocks stay DRY and the timeout logic lives in one place.

Both options are implemented together: the helper encapsulates the correct timeouts and every beforeEach now calls waitForEntityAnalyticsPageReady().

Test plan

  • Verify entities_table_grouping.cy.ts passes locally
  • Check CI on this PR for the three previously-failing suites (Group by Resolution, Switching grouping)

Checklist

  • No hardcoded waits (cy.wait(ms)) introduced
  • No eslint-disable introduced
  • Existing tests unchanged — only beforeEach wiring consolidated

Made with Cursor

MadameSheema and others added 3 commits May 7, 2026 16:56
…eout

After `@entityStoreStatus` resolves the page still needs to wait for
the sourcerer / data-view to finish loading before `EntitiesTableSection`
mounts and fires the POST to /internal/search/ese. In slow CI environments
this cascade routinely exceeds the default 5 s timeout, causing
cy.wait('@entityStoreSearch') to fail with "No request ever occurred"
(elastic#267794, elastic#267795, elastic#267828, elastic#267965).

Option A: raise the timeout on @entityStoreSearch to 20 s (matching
the existing @entityStoreStatus timeout).
Option B: consolidate both waits + waitForGroupingTable into a single
`waitForEntityAnalyticsPageReady` task helper so the logic lives in one
place and every beforeEach block stays consistent.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#12170

[✅] Security Solution Entity Analytics - Cypress: 25/25 tests passed.

see run history

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#12173

[✅] [Serverless] Security Solution Entity Analytics - Cypress: 25/25 tests passed.

see run history

@elastic elastic deleted a comment from kibanamachine May 7, 2026
@MadameSheema MadameSheema self-assigned this May 7, 2026
@MadameSheema MadameSheema added Team:Entity Analytics Security Entity Analytics Team v9.5.0 v9.4.1 release_note:skip Skip the PR/issue when compiling release notes backport:all-open Backport to all branches that could still receive a release labels May 7, 2026
@MadameSheema MadameSheema marked this pull request as ready for review May 7, 2026 18:54
@MadameSheema MadameSheema requested review from a team as code owners May 7, 2026 18:54
@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

Pinging @elastic/security-entity-analytics (Team:Entity Analytics)

@MadameSheema MadameSheema enabled auto-merge (squash) May 7, 2026 20:05
@kibanamachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

cc @MadameSheema

@MadameSheema MadameSheema merged commit fd88e7f into elastic:main May 7, 2026
31 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19, 9.3, 9.4

https://github.com/elastic/kibana/actions/runs/25521951668

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 Some backports could not be created

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- Bump follow-redirects (#268270)
- chore(deps): bump @redocly/cli to 2.30.4 and postcss to 8.5.14 (#268223)
9.3 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.3:
- Bump follow-redirects (#268270)
- chore(deps): bump @redocly/cli to 2.30.4 and postcss to 8.5.14 (#268223)
9.4

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 268217

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request May 7, 2026
…ch timeout (#268217) (#268309)

# Backport

This will backport the following commits from `main` to `9.4`:
- [[EA] Fix flaky entities_table_grouping: extend @entityStoreSearch
timeout (#268217)](#268217)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Gloria
Hornero","email":"gloria.hornero@elastic.co"},"sourceCommit":{"committedDate":"2026-05-07T21:03:08Z","message":"[EA]
Fix flaky entities_table_grouping: extend @entityStoreSearch timeout
(#268217)\n\n## Summary\n\nFixes intermittent failures in
`entities_table_grouping.cy.ts` reported\nin:\n- #267794\n- #267795\n-
#267828\n- #267965\n\n### Root Cause\n\nPR #265125 added
`interceptEntityStoreStatus('running')`
+\n`cy.wait('@entityStoreStatus', { timeout: 20000 })` to
every\n`beforeEach` to prevent the page from
showing\n`EntityStoreDisabledEmptyPrompt`. The intent was correct, but
after\n`@entityStoreStatus` resolves, the page still needs to:\n\n1.
React re-render with the new status data\n2. Wait for
`isSourcererLoading = false` (the sourcerer /
data-view\ninitialization)\n3. Mount `EntitiesTableSection`\n4. Fire the
POST to `/internal/search/ese`\n\nThis cascade can easily take **> 5 s**
in slow CI environments, while\n`cy.wait('@entityStoreSearch')` was left
with the default **5 s\ntimeout** — causing \"No request ever occurred\"
failures.\n\n### Changes\n\n**Option A** — raise the
`@entityStoreSearch` timeout to 20 s,
matching\n`@entityStoreStatus`.\n\n**Option B** — consolidate
`cy.wait('@entityStoreStatus')` +\n`cy.wait('@entityStoreSearch')` +
`waitForGroupingTable()` into a
single\n`waitForEntityAnalyticsPageReady()` task helper, so the
three\n`beforeEach` blocks stay DRY and the timeout logic lives in one
place.\n\nBoth options are implemented together: the helper encapsulates
the\ncorrect timeouts and every `beforeEach` now
calls\n`waitForEntityAnalyticsPageReady()`.\n\n## Test plan\n\n- [ ]
Verify `entities_table_grouping.cy.ts` passes locally\n- [ ] Check CI on
this PR for the three previously-failing suites (Group\nby Resolution,
Switching grouping)\n\n## Checklist\n\n- [x] No hardcoded waits
(`cy.wait(ms)`) introduced\n- [x] No `eslint-disable` introduced\n- [x]
Existing tests unchanged — only `beforeEach` wiring consolidated\n\nMade
with [Cursor](https://cursor.com)\n\n---------\n\nCo-authored-by: Cursor
<cursoragent@cursor.com>","sha":"fd88e7fead56d2c4d274ea588c8449fbc4218534","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","Team:Entity
Analytics","v9.5.0","v9.4.1"],"title":"[EA] Fix flaky
entities_table_grouping: extend @entityStoreSearch
timeout","number":268217,"url":"https://github.com/elastic/kibana/pull/268217","mergeCommit":{"message":"[EA]
Fix flaky entities_table_grouping: extend @entityStoreSearch timeout
(#268217)\n\n## Summary\n\nFixes intermittent failures in
`entities_table_grouping.cy.ts` reported\nin:\n- #267794\n- #267795\n-
#267828\n- #267965\n\n### Root Cause\n\nPR #265125 added
`interceptEntityStoreStatus('running')`
+\n`cy.wait('@entityStoreStatus', { timeout: 20000 })` to
every\n`beforeEach` to prevent the page from
showing\n`EntityStoreDisabledEmptyPrompt`. The intent was correct, but
after\n`@entityStoreStatus` resolves, the page still needs to:\n\n1.
React re-render with the new status data\n2. Wait for
`isSourcererLoading = false` (the sourcerer /
data-view\ninitialization)\n3. Mount `EntitiesTableSection`\n4. Fire the
POST to `/internal/search/ese`\n\nThis cascade can easily take **> 5 s**
in slow CI environments, while\n`cy.wait('@entityStoreSearch')` was left
with the default **5 s\ntimeout** — causing \"No request ever occurred\"
failures.\n\n### Changes\n\n**Option A** — raise the
`@entityStoreSearch` timeout to 20 s,
matching\n`@entityStoreStatus`.\n\n**Option B** — consolidate
`cy.wait('@entityStoreStatus')` +\n`cy.wait('@entityStoreSearch')` +
`waitForGroupingTable()` into a
single\n`waitForEntityAnalyticsPageReady()` task helper, so the
three\n`beforeEach` blocks stay DRY and the timeout logic lives in one
place.\n\nBoth options are implemented together: the helper encapsulates
the\ncorrect timeouts and every `beforeEach` now
calls\n`waitForEntityAnalyticsPageReady()`.\n\n## Test plan\n\n- [ ]
Verify `entities_table_grouping.cy.ts` passes locally\n- [ ] Check CI on
this PR for the three previously-failing suites (Group\nby Resolution,
Switching grouping)\n\n## Checklist\n\n- [x] No hardcoded waits
(`cy.wait(ms)`) introduced\n- [x] No `eslint-disable` introduced\n- [x]
Existing tests unchanged — only `beforeEach` wiring consolidated\n\nMade
with [Cursor](https://cursor.com)\n\n---------\n\nCo-authored-by: Cursor
<cursoragent@cursor.com>","sha":"fd88e7fead56d2c4d274ea588c8449fbc4218534"}},"sourceBranch":"main","suggestedTargetBranches":["9.4"],"targetPullRequestStates":[{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/268217","number":268217,"mergeCommit":{"message":"[EA]
Fix flaky entities_table_grouping: extend @entityStoreSearch timeout
(#268217)\n\n## Summary\n\nFixes intermittent failures in
`entities_table_grouping.cy.ts` reported\nin:\n- #267794\n- #267795\n-
#267828\n- #267965\n\n### Root Cause\n\nPR #265125 added
`interceptEntityStoreStatus('running')`
+\n`cy.wait('@entityStoreStatus', { timeout: 20000 })` to
every\n`beforeEach` to prevent the page from
showing\n`EntityStoreDisabledEmptyPrompt`. The intent was correct, but
after\n`@entityStoreStatus` resolves, the page still needs to:\n\n1.
React re-render with the new status data\n2. Wait for
`isSourcererLoading = false` (the sourcerer /
data-view\ninitialization)\n3. Mount `EntitiesTableSection`\n4. Fire the
POST to `/internal/search/ese`\n\nThis cascade can easily take **> 5 s**
in slow CI environments, while\n`cy.wait('@entityStoreSearch')` was left
with the default **5 s\ntimeout** — causing \"No request ever occurred\"
failures.\n\n### Changes\n\n**Option A** — raise the
`@entityStoreSearch` timeout to 20 s,
matching\n`@entityStoreStatus`.\n\n**Option B** — consolidate
`cy.wait('@entityStoreStatus')` +\n`cy.wait('@entityStoreSearch')` +
`waitForGroupingTable()` into a
single\n`waitForEntityAnalyticsPageReady()` task helper, so the
three\n`beforeEach` blocks stay DRY and the timeout logic lives in one
place.\n\nBoth options are implemented together: the helper encapsulates
the\ncorrect timeouts and every `beforeEach` now
calls\n`waitForEntityAnalyticsPageReady()`.\n\n## Test plan\n\n- [ ]
Verify `entities_table_grouping.cy.ts` passes locally\n- [ ] Check CI on
this PR for the three previously-failing suites (Group\nby Resolution,
Switching grouping)\n\n## Checklist\n\n- [x] No hardcoded waits
(`cy.wait(ms)`) introduced\n- [x] No `eslint-disable` introduced\n- [x]
Existing tests unchanged — only `beforeEach` wiring consolidated\n\nMade
with [Cursor](https://cursor.com)\n\n---------\n\nCo-authored-by: Cursor
<cursoragent@cursor.com>","sha":"fd88e7fead56d2c4d274ea588c8449fbc4218534"}},{"branch":"9.4","label":"v9.4.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Gloria Hornero <gloria.hornero@elastic.co>
Co-authored-by: Cursor <cursoragent@cursor.com>
romulets pushed a commit to romulets/kibana that referenced this pull request May 8, 2026
…eout (elastic#268217)

## Summary

Fixes intermittent failures in `entities_table_grouping.cy.ts` reported
in:
- elastic#267794
- elastic#267795
- elastic#267828
- elastic#267965

### Root Cause

PR elastic#265125 added `interceptEntityStoreStatus('running')` +
`cy.wait('@entityStoreStatus', { timeout: 20000 })` to every
`beforeEach` to prevent the page from showing
`EntityStoreDisabledEmptyPrompt`. The intent was correct, but after
`@entityStoreStatus` resolves, the page still needs to:

1. React re-render with the new status data
2. Wait for `isSourcererLoading = false` (the sourcerer / data-view
initialization)
3. Mount `EntitiesTableSection`
4. Fire the POST to `/internal/search/ese`

This cascade can easily take **> 5 s** in slow CI environments, while
`cy.wait('@entityStoreSearch')` was left with the default **5 s
timeout** — causing "No request ever occurred" failures.

### Changes

**Option A** — raise the `@entityStoreSearch` timeout to 20 s, matching
`@entityStoreStatus`.

**Option B** — consolidate `cy.wait('@entityStoreStatus')` +
`cy.wait('@entityStoreSearch')` + `waitForGroupingTable()` into a single
`waitForEntityAnalyticsPageReady()` task helper, so the three
`beforeEach` blocks stay DRY and the timeout logic lives in one place.

Both options are implemented together: the helper encapsulates the
correct timeouts and every `beforeEach` now calls
`waitForEntityAnalyticsPageReady()`.

## Test plan

- [ ] Verify `entities_table_grouping.cy.ts` passes locally
- [ ] Check CI on this PR for the three previously-failing suites (Group
by Resolution, Switching grouping)

## Checklist

- [x] No hardcoded waits (`cy.wait(ms)`) introduced
- [x] No `eslint-disable` introduced
- [x] Existing tests unchanged — only `beforeEach` wiring consolidated

Made with [Cursor](https://cursor.com)

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
mgadewoll pushed a commit to mgadewoll/kibana that referenced this pull request May 8, 2026
…eout (elastic#268217)

## Summary

Fixes intermittent failures in `entities_table_grouping.cy.ts` reported
in:
- elastic#267794
- elastic#267795
- elastic#267828
- elastic#267965

### Root Cause

PR elastic#265125 added `interceptEntityStoreStatus('running')` +
`cy.wait('@entityStoreStatus', { timeout: 20000 })` to every
`beforeEach` to prevent the page from showing
`EntityStoreDisabledEmptyPrompt`. The intent was correct, but after
`@entityStoreStatus` resolves, the page still needs to:

1. React re-render with the new status data
2. Wait for `isSourcererLoading = false` (the sourcerer / data-view
initialization)
3. Mount `EntitiesTableSection`
4. Fire the POST to `/internal/search/ese`

This cascade can easily take **> 5 s** in slow CI environments, while
`cy.wait('@entityStoreSearch')` was left with the default **5 s
timeout** — causing "No request ever occurred" failures.

### Changes

**Option A** — raise the `@entityStoreSearch` timeout to 20 s, matching
`@entityStoreStatus`.

**Option B** — consolidate `cy.wait('@entityStoreStatus')` +
`cy.wait('@entityStoreSearch')` + `waitForGroupingTable()` into a single
`waitForEntityAnalyticsPageReady()` task helper, so the three
`beforeEach` blocks stay DRY and the timeout logic lives in one place.

Both options are implemented together: the helper encapsulates the
correct timeouts and every `beforeEach` now calls
`waitForEntityAnalyticsPageReady()`.

## Test plan

- [ ] Verify `entities_table_grouping.cy.ts` passes locally
- [ ] Check CI on this PR for the three previously-failing suites (Group
by Resolution, Switching grouping)

## Checklist

- [x] No hardcoded waits (`cy.wait(ms)`) introduced
- [x] No `eslint-disable` introduced
- [x] Existing tests unchanged — only `beforeEach` wiring consolidated

Made with [Cursor](https://cursor.com)

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:all-open Backport to all branches that could still receive a release release_note:skip Skip the PR/issue when compiling release notes Team:Entity Analytics Security Entity Analytics Team v9.4.1 v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants