Skip to content

[Console] Stub window.open in serverless docs test to avoid external tab hang - #288197

Open
kibanamachine wants to merge 1 commit into
mainfrom
fix/flaky-253933-console-docs-external-tab-7368258c4fbe59f9
Open

[Console] Stub window.open in serverless docs test to avoid external tab hang#288197
kibanamachine wants to merge 1 commit into
mainfrom
fix/flaky-253933-console-docs-external-tab-7368258c4fbe59f9

Conversation

@kibanamachine

Copy link
Copy Markdown
Contributor

Fixes #253933

Summary

  • The serverless Console test should open API Reference documentation page when open documentation button is clicked timed out at retry.try (console.ts:59) with Timed out receiving message from renderer: 300.000.
  • The test switched into the external elastic.co docs tab and polled browser.getCurrentUrl() against it; a live external page keeps the renderer busy, so the WebDriver command never returns.
  • This patch stubs window.open before the click to capture the URL the app would open, asserts on it in-app, and drops the switchTab / getCurrentUrl / closeCurrentWindow dance — removing the external-navigation race entirely while keeping the click-wiring coverage (openDocswindow.open with the resolved docs URL).

Context

  • Follows the fix proposed by the Failed Test Investigator; the only deviation is typing the captured URL via a declare global Window augmentation instead of any/@ts-expect-error, per repo conventions.
  • The failure screenshot showed the docs page fully rendered, so the feature works — this is a test-design issue, not an app bug. URL resolution is already unit-tested in getDocumentationLink.
  • Same signature recurred on kibana-on-merge/main across two failures ~6 months apart (build 88600, build 108237), always on this one test that opens an external tab — pointing at the external-navigation design, not a random CI hiccup.
Verification

Verified locally

✅ Passed: node scripts/eslint x-pack/platform/test/serverless/functional/test_suites/console/console.ts

Not verified locally

  • This is a serverless FTR test requiring a live Elasticsearch + Kibana, which cannot run in this environment. Behavior under CI will be exercised by the PR's own functional test run.
Backporting guidance

Applied backport:version with v9.5.3 and v9.4.6: the patched file exists at the identical path with the identical faulty pattern on the 9.5 and 9.4 release branches, so the patch applies unchanged. Excluded 8.19 — the test does not exist at this path (or the legacy x-pack/test_serverless/... path) on that branch, so no backport is needed there.

Note

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

Generated by Flaky Test Fixer for #253933 · opus · 353.8 AIC · ⌖ 41.1 AIC · ⊞ 13.2K ·

Fixes #253933

The test switched into the external elastic.co docs tab and ran
getCurrentUrl() against it, which hung the WebDriver renderer for 300s.
Stub window.open to capture the opened URL in-app and assert on it,
removing the external-navigation race.
@kibanamachine

Copy link
Copy Markdown
Contributor Author

/flaky ftrConfig:x-pack/platform/test/serverless/functional/configs/search/config.group1.ts:30

Generated by Flaky Fix Verifier for #288197 · opus · 139.1 AIC · ⌖ 44.5 AIC · ⊞ 13.6K ·

@github-actions github-actions Bot added the flaky-fix-check:started Flaky fix verifier: a flaky test runner check has been triggered; in progress. label Aug 31, 2026
@kibanamachine

Copy link
Copy Markdown
Contributor Author

Flaky Test Runner

✅ Build triggered - kibana-flaky-test-suite-runner#14156

  • x-pack/platform/test/serverless/functional/configs/search/config.group1.ts x30

@kibanamachine

Copy link
Copy Markdown
Contributor Author

Flaky Test Runner Stats

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

[✅] x-pack/platform/test/serverless/functional/configs/search/config.group1.ts: 30/30 tests passed.

see run history

@github-actions github-actions Bot added flaky-fix-check:passed Flaky fix verifier: targeted test held across the run(s); fix confirmed. and removed flaky-fix-check:started Flaky fix verifier: a flaky test runner check has been triggered; in progress. labels Aug 31, 2026
@kibanamachine
kibanamachine marked this pull request as ready for review August 31, 2026 21:15
@kibanamachine
kibanamachine requested a review from a team as a code owner August 31, 2026 21:15
@kibanamachine
kibanamachine enabled auto-merge (squash) August 31, 2026 21:15
@kibanamachine

Copy link
Copy Markdown
Contributor Author

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

Test Failures

  • [job] [logs] FTR Configs #43 / Screenshotting Example should capture a screenshot
  • [job] [logs] FTR Configs #20 / serverless observability UI - Cases and Rules Serverless Observability Cases Case View Files adds a file to the case

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

Labels

backport:version Backport to applied version labels flaky-fix-check:passed Flaky fix verifier: targeted test held across the run(s); fix confirmed. flaky-test-fixer Automated PR created by the flaky test fixer workflow release_note:skip Skip the PR/issue when compiling release notes v9.4.6 v9.5.3

Projects

None yet

1 participant