← Back to Pull requests

[9.6] [Accessibility] Remove flights sample data via API in a11y teardown (#300490) #300623

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Oct 26, 2026 17:12 UTC
Author

Backport

This will backport the following commits from main to 9.6:
- [[Accessibility] Remove flights sample data via API in a11y teardown (#300490)](https://github.com/elastic/kibana/pull/300490)

<!--- Backport version: 12.1.2 -->

Questions ?


Please refer to the Backport tool documentation

<!--BACKPORT [{"author":{"name":"Kibana Machine","email":"42973632+kibanamachine@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-10-26T16:37:31Z","message":"[Accessibility] Remove flights sample data via API in a11y teardown (#300490)\n\nFixes #299110\n\n### Summary\n\n- The a11y tests using flights sample data after hook removed the\nsample data through the Home UI and then polled the card's\ndata-status attribute for 118 s. The card never left installed, so\nmocha's 120 s hookTimeout fired first, FTR aborted the config, and all\n7 Management data views a11y specs were recorded as skipped.\n- Tear the data set down through DELETE /api/sample_data/flights\ninstead, per Prefer Kibana APIs over UI for setup and\nteardown.\nThis removes the browser, the click, and the card's status mirror from\nthe teardown path entirely.\n- kibanaServer.uiSettings.unset('defaultIndex') replaces what the UI\nremoval did on the client\n(services.tsx);\nwithout it defaultIndex would keep pointing at the flights data view\nthat the following savedObjects.clean deletes.\n- before stays on the UI: it is not what failed, and its install path\nwrites the defaultIndex the dashboard and visualize specs run against.\n\n### Context\n\n- This patch follows the investigator's proposed\nfix,\nbut not its root-cause mechanism. That comment states Kibana's ops\nmetrics report requests.total = 0 for seven consecutive 10 s windows\nafter the click, concluding the DELETE never left the browser. The job\nlog contains no ops-metrics lines at all — the 12 periodic proc\n[kibana] lines inside the after hook are Elasticsearch\n_monitoring/bulk deprecation warnings, emitted on the same 10 s\ncadence. The earlier comment on this\nissue\nblamed an unbounded p-retry backoff in pollForRemoval, and the\nfirst fixer\npass\nrefuted it on that same unsupported reading. Neither mechanism is\nestablished.\n- What the captured FTR debug log does show\n(target/test_failures/.log on the failing job): the Remove button was\nfound and clicked at 00:02:01 without error, Waiting up to 120000ms\nfor flights sample data to be removed... at 00:02:02, then 976\nconsecutive Sample data installed: true polls through 00:03:59. No\nbrowser console error for /api/sample_data (only three unrelated\n/internal/security/user_profile 404s) and no error toast.\n- The test cannot tell what state it is in. data-status is React\nstate on the card footer\n(footer/index.tsx)\nthat only flips once onRemove fires — which useRemove calls after\nboth the DELETE and a client-side poll resolve — and EuiButtonEmpty\nisLoading keeps removeSampleDataSetflights mounted while removing\n(remove_footer.tsx).\nSo removal pending and removal never started are indistinguishable\nfrom this signal, there is no screenshot for a hook failure, and there\nis no recovery path from either. Rather than keep guessing between them,\nthis drops the dependency on that signal.\n- The failure message carries no information, which is why three\npasses over this issue could not name the mechanism:\nremoveSampleDataSet waits 120_000 ms\n(home_page.ts)\nand FTR's mochaOpts.hookTimeout defaults to 120_000, so mocha always\nwins and the error is a bare ERR_MOCHA_TIMEOUT instead of timed out\nwaiting for flights sample data to be removed.\n- No coverage is lost. Removing flights through the UI is what\nsample_data_install.spec.ts\nexists to assert; this a11y suite only consumes the data.\n- Reported twice on kibana-on-merge: main, build\n113296\n(2026-10-20) and 9.6, build\n113976\n(2026-10-26). Both retried jobs passed, so removal itself works — the\nteardown just converts an intermittent hiccup into a config-wide abort.\n- Several x-pack a11y suites share this UI-teardown shape and deserve\nthe same treatment; this patch stays on the failing file.\n\n<details>\n<summary>Verification</summary>\n\n#### Verified locally\n\n- ✅ Passed: node scripts/eslint\nsrc/platform/test/accessibility/apps/index.ts\n- ✅ Passed: confirmed supertest is registered for this config —\nsrc/platform/test/accessibility/services/index.ts spreads\nsrc/platform/test/functional/services, which registers it at\nservices/index.ts:96. The call mirrors the existing helper at\nx-pack/platform/test/functional/services/sample_data/test_resources.ts:26-33.\n\n#### Not verified locally\n\n- The suite itself was not run: FTR needs a live Elasticsearch + Kibana,\nwhich this environment does not provide.\n- Type checking was left to CI.\n- DELETE /api/sample_data/flights returns 204 only when the data set\nis installed, which the before hook guarantees; the stricter\n.expect(204) was not exercised against a real server here.\n\n</details>\n\n> [!IMPORTANT]\n> The flaky test runner may verify the PR, but the owning team is\nresponsible the next steps:\n>\n> - Review and merge it (update the branch or add missing labels if\nneeded)\n> - Make changes (check out the branch locally, or ask @copilot if\nCopilot is enabled on your account)\n> - Close it if it is not worth shipping (share feedback in #kibana-qa)\n\n> Generated by Flaky Test\nFixer for\n#299110 · claude · opus · 421.2 AIC · ⌖ 57.4 AIC · ⊞ 15.2K ·\n◷\n\n\n\n\n\n\nCo-authored-by: Claude Opus 4.8 <noreply@anthropic.com>","sha":"eb9ab15b42ebda9e3ea5a0fe6de349184ad88e53","branchLabelMapping":{"^v9.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:QA","release_note:skip","backport:version","flaky-test-fixer","flaky-fix-check:passed","v9.6.0","v9.5.6","v9.4.9","v9.7.0"],"title":"[Accessibility] Remove flights sample data via API in a11y teardown","number":300490,"url":"https://github.com/elastic/kibana/pull/300490","mergeCommit":{"message":"[Accessibility] Remove flights sample data via API in a11y teardown (#300490)\n\nFixes #299110\n\n### Summary\n\n- The a11y tests using flights sample data after hook removed the\nsample data through the Home UI and then polled the card's\ndata-status attribute for 118 s. The card never left installed, so\nmocha's 120 s hookTimeout fired first, FTR aborted the config, and all\n7 Management data views a11y specs were recorded as skipped.\n- Tear the data set down through DELETE /api/sample_data/flights\ninstead, per Prefer Kibana APIs over UI for setup and\nteardown.\nThis removes the browser, the click, and the card's status mirror from\nthe teardown path entirely.\n- kibanaServer.uiSettings.unset('defaultIndex') replaces what the UI\nremoval did on the client\n(services.tsx);\nwithout it defaultIndex would keep pointing at the flights data view\nthat the following savedObjects.clean deletes.\n- before stays on the UI: it is not what failed, and its install path\nwrites the defaultIndex the dashboard and visualize specs run against.\n\n### Context\n\n- This patch follows the investigator's proposed\nfix,\nbut not its root-cause mechanism. That comment states Kibana's ops\nmetrics report requests.total = 0 for seven consecutive 10 s windows\nafter the click, concluding the DELETE never left the browser. The job\nlog contains no ops-metrics lines at all — the 12 periodic proc\n[kibana] lines inside the after hook are Elasticsearch\n_monitoring/bulk deprecation warnings, emitted on the same 10 s\ncadence. The earlier comment on this\nissue\nblamed an unbounded p-retry backoff in pollForRemoval, and the\nfirst fixer\npass\nrefuted it on that same unsupported reading. Neither mechanism is\nestablished.\n- What the captured FTR debug log does show\n(target/test_failures/.log on the failing job): the Remove button was\nfound and clicked at 00:02:01 without error, Waiting up to 120000ms\nfor flights sample data to be removed... at 00:02:02, then 976\nconsecutive Sample data installed: true polls through 00:03:59. No\nbrowser console error for /api/sample_data (only three unrelated\n/internal/security/user_profile 404s) and no error toast.\n- The test cannot tell what state it is in. data-status is React\nstate on the card footer\n(footer/index.tsx)\nthat only flips once onRemove fires — which useRemove calls after\nboth the DELETE and a client-side poll resolve — and EuiButtonEmpty\nisLoading keeps removeSampleDataSetflights mounted while removing\n(remove_footer.tsx).\nSo removal pending and removal never started are indistinguishable\nfrom this signal, there is no screenshot for a hook failure, and there\nis no recovery path from either. Rather than keep guessing between them,\nthis drops the dependency on that signal.\n- The failure message carries no information, which is why three\npasses over this issue could not name the mechanism:\nremoveSampleDataSet waits 120_000 ms\n(home_page.ts)\nand FTR's mochaOpts.hookTimeout defaults to 120_000, so mocha always\nwins and the error is a bare ERR_MOCHA_TIMEOUT instead of timed out\nwaiting for flights sample data to be removed.\n- No coverage is lost. Removing flights through the UI is what\nsample_data_install.spec.ts\nexists to assert; this a11y suite only consumes the data.\n- Reported twice on kibana-on-merge: main, build\n113296\n(2026-10-20) and 9.6, build\n113976\n(2026-10-26). Both retried jobs passed, so removal itself works — the\nteardown just converts an intermittent hiccup into a config-wide abort.\n- Several x-pack a11y suites share this UI-teardown shape and deserve\nthe same treatment; this patch stays on the failing file.\n\n<details>\n<summary>Verification</summary>\n\n#### Verified locally\n\n- ✅ Passed: node scripts/eslint\nsrc/platform/test/accessibility/apps/index.ts\n- ✅ Passed: confirmed supertest is registered for this config —\nsrc/platform/test/accessibility/services/index.ts spreads\nsrc/platform/test/functional/services, which registers it at\nservices/index.ts:96. The call mirrors the existing helper at\nx-pack/platform/test/functional/services/sample_data/test_resources.ts:26-33.\n\n#### Not verified locally\n\n- The suite itself was not run: FTR needs a live Elasticsearch + Kibana,\nwhich this environment does not provide.\n- Type checking was left to CI.\n- DELETE /api/sample_data/flights returns 204 only when the data set\nis installed, which the before hook guarantees; the stricter\n.expect(204) was not exercised against a real server here.\n\n</details>\n\n> [!IMPORTANT]\n> The flaky test runner may verify the PR, but the owning team is\nresponsible the next steps:\n>\n> - Review and merge it (update the branch or add missing labels if\nneeded)\n> - Make changes (check out the branch locally, or ask @copilot if\nCopilot is enabled on your account)\n> - Close it if it is not worth shipping (share feedback in #kibana-qa)\n\n> Generated by Flaky Test\nFixer for\n#299110 · claude · opus · 421.2 AIC · ⌖ 57.4 AIC · ⊞ 15.2K ·\n◷\n\n\n\n\n\n\nCo-authored-by: Claude Opus 4.8 <noreply@anthropic.com>","sha":"eb9ab15b42ebda9e3ea5a0fe6de349184ad88e53"}},"sourceBranch":"main","suggestedTargetBranches":["9.6","9.5","9.4"],"targetPullRequestStates":[{"branch":"9.6","label":"v9.6.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.5","label":"v9.5.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.4","label":"v9.4.9","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.7.0","branchLabelMappingKey":"^v9.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/300490","number":300490,"mergeCommit":{"message":"[Accessibility] Remove flights sample data via API in a11y teardown (#300490)\n\nFixes #299110\n\n### Summary\n\n- The a11y tests using flights sample data after hook removed the\nsample data through the Home UI and then polled the card's\ndata-status attribute for 118 s. The card never left installed, so\nmocha's 120 s hookTimeout fired first, FTR aborted the config, and all\n7 Management data views a11y specs were recorded as skipped.\n- Tear the data set down through DELETE /api/sample_data/flights\ninstead, per Prefer Kibana APIs over UI for setup and\nteardown.\nThis removes the browser, the click, and the card's status mirror from\nthe teardown path entirely.\n- kibanaServer.uiSettings.unset('defaultIndex') replaces what the UI\nremoval did on the client\n(services.tsx);\nwithout it defaultIndex would keep pointing at the flights data view\nthat the following savedObjects.clean deletes.\n- before stays on the UI: it is not what failed, and its install path\nwrites the defaultIndex the dashboard and visualize specs run against.\n\n### Context\n\n- This patch follows the investigator's proposed\nfix,\nbut not its root-cause mechanism. That comment states Kibana's ops\nmetrics report requests.total = 0 for seven consecutive 10 s windows\nafter the click, concluding the DELETE never left the browser. The job\nlog contains no ops-metrics lines at all — the 12 periodic proc\n[kibana] lines inside the after hook are Elasticsearch\n_monitoring/bulk deprecation warnings, emitted on the same 10 s\ncadence. The earlier comment on this\nissue\nblamed an unbounded p-retry backoff in pollForRemoval, and the\nfirst fixer\npass\nrefuted it on that same unsupported reading. Neither mechanism is\nestablished.\n- What the captured FTR debug log does show\n(target/test_failures/.log on the failing job): the Remove button was\nfound and clicked at 00:02:01 without error, Waiting up to 120000ms\nfor flights sample data to be removed... at 00:02:02, then 976\nconsecutive Sample data installed: true polls through 00:03:59. No\nbrowser console error for /api/sample_data (only three unrelated\n/internal/security/user_profile 404s) and no error toast.\n- The test cannot tell what state it is in. data-status is React\nstate on the card footer\n(footer/index.tsx)\nthat only flips once onRemove fires — which useRemove calls after\nboth the DELETE and a client-side poll resolve — and EuiButtonEmpty\nisLoading keeps removeSampleDataSetflights mounted while removing\n(remove_footer.tsx).\nSo removal pending and removal never started are indistinguishable\nfrom this signal, there is no screenshot for a hook failure, and there\nis no recovery path from either. Rather than keep guessing between them,\nthis drops the dependency on that signal.\n- The failure message carries no information, which is why three\npasses over this issue could not name the mechanism:\nremoveSampleDataSet waits 120_000 ms\n(home_page.ts)\nand FTR's mochaOpts.hookTimeout defaults to 120_000, so mocha always\nwins and the error is a bare ERR_MOCHA_TIMEOUT instead of timed out\nwaiting for flights sample data to be removed.\n- No coverage is lost. Removing flights through the UI* is what\nsample_data_install.spec.ts\nexists to assert; this a11y suite only consumes the data.\n- Reported twice on kibana-on-merge: main, build\n113296\n(2026-10-20) and 9.6, build\n113976\n(2026-10-26). Both retried jobs passed, so removal itself works — the\nteardown just converts an intermittent hiccup into a config-wide abort.\n- Several x-pack a11y suites share this UI-teardown shape and deserve\nthe same treatment; this patch stays on the failing file.\n\n<details>\n<summary>Verification</summary>\n\n#### Verified locally\n\n- ✅ Passed: node scripts/eslint\nsrc/platform/test/accessibility/apps/index.ts\n- ✅ Passed: confirmed supertest is registered for this config —\nsrc/platform/test/accessibility/services/index.ts spreads\nsrc/platform/test/functional/services, which registers it at\nservices/index.ts:96. The call mirrors the existing helper at\nx-pack/platform/test/functional/services/sample_data/test_resources.ts:26-33.\n\n#### Not verified locally\n\n- The suite itself was not run: FTR needs a live Elasticsearch + Kibana,\nwhich this environment does not provide.\n- Type checking was left to CI.\n- DELETE /api/sample_data/flights returns 204 only when the data set\nis installed, which the before hook guarantees; the stricter\n.expect(204) was not exercised against a real server here.\n\n</details>\n\n> [!IMPORTANT]\n> The flaky test runner may verify the PR, but the owning team is\nresponsible the next steps:\n>\n> - Review and merge it (update the branch or add missing labels if\nneeded)\n> - Make changes (check out the branch locally, or ask @copilot if\nCopilot is enabled on your account)\n> - Close it if it is not worth shipping (share feedback in #kibana-qa)\n\n> Generated by Flaky Test\nFixer for\n#299110 · claude · opus · 421.2 AIC · ⌖ 57.4 AIC · ⊞ 15.2K ·\n◷\n\n\n\n\n\n\nCo-authored-by: Claude Opus 4.8 <noreply@anthropic.com>","sha":"eb9ab15b42ebda9e3ea5a0fe6de349184ad88e53"}}]}] BACKPORT-->

Diff: 650 lines (+487 / -163) across 8 files Reviewer: github-actions[bot] Review duration: 2m
All Vouch review confidence checks passed
Residual risk 0.43 = Change Risk (0.52) × (1 − Review Confidence (0.17)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
0.52
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 14% · Reviewer familiarity: 35%
16%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.388
Shallow Review Depth shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #300623"
general weight: 0.35
Assignees
Unassigned
Labels
risk: medium confidence: 16.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 52% (MEDIUM) · Higher = larger blast radius
52%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 16.5% · Lower = rushed or shallow review
16.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 43.4% · Moderate risk
43.4%
Repository