[9.4] [Security Solution] Split ReputationLink tooltip test per link to fit Jest budget (#290216) - #290644
Merged
Conversation
… Jest budget (elastic#290216) Fixes elastic#253551 ### Summary - The Jest test `ReputationLink › number of links › it renders correct number of tooltips by default` timed out against the 5000ms budget on CI. - It hovered all five reputation links in one sequential loop, so the cumulative EUI tooltip show-delays (each `EuiToolTip` inherits EUI's default ~250ms) plus `userEvent`/`waitFor` overhead tipped a single test past 5s under CI parallel load. - Split the loop into a `test.each` over the five links, so each hover + tooltip assertion runs as its own test with its own 5s budget — full coverage kept, cumulative-budget problem removed. | Runtime vs. 5s budget | Passed (local) | Avg | Max | | --- | --- | --- | --- | | Before fix — 1 test, 5 sequential hovers | 1/1 | 0.41s | 0.41s | | After fix — 5 tests, 1 hover each | 60/60 | 0.12s | 0.25s | ### Context - Follows the [failed-test investigator's primary proposal](elastic#253551 (comment)) (the `test.each` "smaller unit" cost cut); its fallback was a Jest timeout bump, which isn't needed since the split already gives ~20× headroom per test. - Confirmed a cost/budget timeout, not a "tooltip never appears" race: locally the unpatched test passes at 413ms (8% of budget), and each split test now runs in ≤254ms with its own budget. - Failures were occasional and load-dependent: first 2026-02-17 (`kibana-on-merge` main), again 2026-07-26 (`kibana-fips`), auto-closed after 3 quiet weeks, reopened 2026-09-09 ([`kibana-on-merge` elastic#109210](https://buildkite.com/elastic/kibana-on-merge/builds/109210#01a08663-8a07-4b6e-aab1-0637ae4b7c55)). <details> <summary>Verification</summary> #### Verified locally - ✅ Passed: `node scripts/eslint x-pack/solutions/security/plugins/security_solution/public/common/components/links/index.test.tsx` - ✅ Passed: `node scripts/jest .../links/index.test.tsx -t "renders correct tooltip for link"`: 12/12 file runs green (60/60 split-test executions, 0 failed assertions); slowest single split test 249ms. #### Not verified locally - The flake only manifests under CI parallel-load contention; locally the unpatched test passes at 413ms (8% of the 5s budget), so a multi-run reproduction loop can't fail here and wasn't run at scale. Neither the before nor after measurements ran under CI parallel load. </details> > [!NOTE] > Requested by @csr. Share feedback in #kibana-qa. Mention `@copilot` to make quick changes. > Generated by [Flaky Test Fixer](https://github.com/elastic/kibana/actions/runs/34452670976) for elastic#253551 · claude · opus · 253.4 AIC · ⌖ 36.1 AIC · ⊞ 14.5K · [◷](https://github.com/search?q=repo%3Aelastic%2Fkibana+%22gh-aw-workflow-id%3A+flaky-test-fixer%22&type=pullrequests) <!-- gh-aw-agentic-workflow: Flaky Test Fixer, engine: claude, version: 2.1.165, model: opus, id: 34452670976, workflow_id: flaky-test-fixer, run: https://github.com/elastic/kibana/actions/runs/34452670976 --> <!-- gh-aw-workflow-id: flaky-test-fixer --> <!-- gh-aw-workflow-call-id: elastic/kibana/flaky-test-fixer --> Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com> Co-authored-by: Cesare de Cal <cesare.decal@elastic.co> (cherry picked from commit 80431f1)
Contributor
Author
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
Test Failures |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto9.4:Questions ?
Please refer to the Backport tool documentation