Skip to content

[9.4] [Security Solution] Split ReputationLink tooltip test per link to fit Jest budget (#290216) - #290644

Merged
kibanamachine merged 1 commit into
elastic:9.4from
kibanamachine:backport/9.4/pr-290216
Sep 11, 2026
Merged

[9.4] [Security Solution] Split ReputationLink tooltip test per link to fit Jest budget (#290216)#290644
kibanamachine merged 1 commit into
elastic:9.4from
kibanamachine:backport/9.4/pr-290216

Conversation

@kibanamachine

Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.4:

Questions ?

Please refer to the Backport tool documentation

… 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)
@kibanamachine kibanamachine self-assigned this Sep 11, 2026
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Sep 11, 2026
@kibanamachine
kibanamachine enabled auto-merge (squash) September 11, 2026 16:44
@kibanamachine

Copy link
Copy Markdown
Contributor Author

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

Test Failures

  • [job] [logs] FTR Configs #84 / dashboard app - group 4 dashboard listing page edit meta data saves changes to dashboard metadata

cc @kibanamachine

@kibanamachine
kibanamachine merged commit 5962131 into elastic:9.4 Sep 11, 2026
59 of 60 checks passed
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.

1 participant