Skip to content

[Endpoint] Raise Jest budget for flaky CommandSelector console test - #290474

Open
kibanamachine wants to merge 1 commit into
mainfrom
fix/flaky-287719-command-selector-jest-timeout-25acdc8b52b12d30
Open

[Endpoint] Raise Jest budget for flaky CommandSelector console test#290474
kibanamachine wants to merge 1 commit into
mainfrom
fix/flaky-287719-command-selector-jest-timeout-25acdc8b52b12d30

Conversation

@kibanamachine

Copy link
Copy Markdown
Contributor

Fixes #287719

Summary

  • The Jest test Console: CommandSelector when no command has been entered should update the console input with the selected command and close the popover threw a bare Exceeded timeout of 5000 ms (run took 5.37s) — a per-test timeout, not an assertion failure.
  • Every test in the file mounts the full Console and renders the EuiSelectable option list, which is intrinsically the slow part; under parallel CI load the render tips over the default 5s budget.
  • This raises the file's Jest budget to jest.setTimeout(60_000), clearing the observed 5.37s slow run by ~11×.

Context

  • Follows the Failed Test Investigator's analysis: CommandSelector builds its options synchronously (useMemo over in-memory command definitions), so there is no product-side race and no earlier readiness signal a wait could reach — the render itself is the cost. Per the Jest guardrails, a timeout bump is the sanctioned fix when the render is the slow part.
  • The cost-cutting alternative (rendering CommandSelector against the console state provider directly instead of mounting the whole Console) would be a larger rewrite touching every test in the file, so the file-scoped bump is the smaller correct change.
  • 60_000 matches existing precedent in this plugin (e.g. filters.test.tsx).
  • Failures observed on kibana-on-merge - main (first, recurrence 2026-09-11).
Verification

Verified locally

  • ✅ Passed: node scripts/eslint x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/components/command_selector.test.tsx
  • ✅ Passed: node scripts/jest .../command_selector.test.tsx — full file passes with the fix; the previously failing test completes in ~1.0s in isolation.

Not verified locally

  • The flake does not reproduce in a single-worker local run: every test — including the failing one — completes in ~1s, roughly 5× under the 5s budget. The 5.37s timeout only manifests under CI's parallel worker load, which cannot be reproduced here, so the 25× before/after loop is omitted (it would sit far under budget on every run and prove nothing). The timeout bump does not change render behavior, only the budget ceiling, so the render remains as fast as before.

Note

Share feedback in #kibana-qa. Mention @copilot to make quick changes.

Generated by Flaky Test Fixer for #287719 · claude · opus · 232.8 AIC · ⌖ 68.3 AIC · ⊞ 14.5K ·

The full-Console render in each test can exceed the default 5s budget
under parallel CI load; raise the file's timeout to a wide margin.
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown
🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!
  • Click to trigger kibana-entity-store-performance-from-pr for this PR!
  • Click to trigger kibana-storybooks-from-pr for this PR!

@github-actions github-actions Bot added backport:skip This PR does not require backporting flaky-fix-check:skipped Flaky fix verifier: runner can't verify this fix (e.g. no Jest support) release_note:skip Skip the PR/issue when compiling release notes labels Sep 11, 2026
@kibanamachine

Copy link
Copy Markdown
Contributor Author

⏭️ Flaky-fix verification skipped

This is a Jest-only change (a file-scoped jest.setTimeout(60_000) bump), so the /flaky runner can't verify it — required CI is the whole verdict. Applied release_note:skip and backport:skip.

Why the flaky test runner wasn't used

The /flaky runner accepts only FTR and Scout configs. This PR only touches command_selector.test.tsx, a Jest unit test, which the fixer already verifies by local repetition. The bump is the sanctioned fix here: the EuiSelectable option-list render is intrinsically the slow part, so there is no earlier readiness signal a wait could reach.

How release-note and backport labels were chosen

Applied release_note:skip because this is a test-only change (raising the Jest timeout) with no user-facing effect.

  • v9.5.4 → skip; command_selector.test.tsx does not exist on the 9.5 branch, so there is nothing to backport.
  • v9.4.7 → skip; the file does not exist on the 9.4 branch.
  • v8.19.22 → skip; the file does not exist on the 8.19 branch.

Generated by Flaky Fix Verifier for #290474 · claude · opus · 135.7 AIC · ⌖ 61.1 AIC · ⊞ 15.8K ·

@kibanamachine
kibanamachine marked this pull request as ready for review September 11, 2026 09:23
@kibanamachine
kibanamachine requested a review from a team as a code owner September 11, 2026 09:23
@kibanamachine
kibanamachine enabled auto-merge (squash) September 11, 2026 09:23
@kibanamachine

Copy link
Copy Markdown
Contributor Author

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting flaky-fix-check:skipped Flaky fix verifier: runner can't verify this fix (e.g. no Jest support) flaky-test-fixer Automated PR created by the flaky test fixer workflow release_note:skip Skip the PR/issue when compiling release notes

Projects

None yet

1 participant