[ML] Fix flaky source_selection test by asserting against the visible callout copy#280705
Merged
kibanamachine merged 1 commit intoJul 24, 2026
Conversation
The CcsErrorCallOut uses `announceOnMount`, which renders a duplicate screen-reader copy of the title and body. Switch the three positive assertions from single-match `queryByText` to `getAllByText(...)[0]` to assert against the visible copy. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
⏭️ Flaky-fix verification skippedThe flaky test runner isn't used here: this fix touches only a Jest unit test (
|
kibanamachine
marked this pull request as ready for review
July 24, 2026 09:41
kibanamachine
enabled auto-merge (squash)
July 24, 2026 09:41
Contributor
Author
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
|
kibanamachine
deleted the
fix/flaky-280686-source-selection-callout-announce-027d2b05460cd583
branch
July 24, 2026 18:35
Contributor
Author
|
Starting backport for target branches: 9.3, 9.4, 9.5 |
This was referenced Jul 24, 2026
Contributor
Author
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kibanamachine
added a commit
that referenced
this pull request
Jul 24, 2026
…isible callout copy (#280705) (#280875) # Backport This will backport the following commits from `main` to `9.5`: - [[ML] Fix flaky source_selection test by asserting against the visible callout copy (#280705)](#280705) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Kibana Machine","email":"42973632+kibanamachine@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-07-24T18:35:13Z","message":"[ML] Fix flaky source_selection test by asserting against the visible callout copy (#280705)\n\nFixes #280686 - likely introduced by #235054 (cc `@paulinashakirova`)\n\n### Summary\n\n- The `analyticsCreateSourceIndexModalCcsErrorCallOut` callout is\nrendered with `announceOnMount`, so EUI mounts a screen-reader\n`role=\"status\"` copy of the title (and body) alongside the visible copy.\n- Three positive assertions used single-match `queryByText(...)`, which\nthrows `Found multiple elements` whenever the SR copy is present — a\ntiming-dependent flake.\n- This patch switches those three assertions to `getAllByText(...)[0]`,\nasserting against the visible copy (which precedes the live-region copy\nin the DOM). No production change — `announceOnMount` is intended a11y\nbehavior.\n\n### Context\n\n- Follows the [failed-test investigator's proposed\nfix](https://github.com/elastic/kibana/issues/280686#issuecomment-5068150163)\nexactly (the already-merged `getAllByText(...)[0]` pattern from\n#269061).\n- Failure was on `main` in the `kibana-on-merge` Jest lane ([build\n103893](https://buildkite.com/elastic/kibana-on-merge/builds/103893#019f9342-9398-4616-9954-22fbe43a9695));\nthe `announceOnMount` copy is populated on a `setTimeout`, so whether\nthe duplicate exists when the assertion runs is a race.\n- Also fixes the identical title+body assertions in the sibling test\n(subject of #254968), which carry the same bug.\n\n<details>\n<summary>Verification</summary>\n\n#### Verified locally\n\n- `✅ Passed: node scripts/eslint\nx-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx`\n- `✅ Passed: node scripts/jest\nx-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx`\n— all 5 tests pass\n\n#### Not verified locally\n\n- `node scripts/type_check --project\nx-pack/platform/plugins/shared/ml/tsconfig.json` was killed by the\nsandbox's memory limit (SIGKILL) before completing, twice. The change is\na test-only edit using standard `@testing-library/react` APIs\n(`getAllByText(...)[0]` returns an `HTMLElement`) and introduces no new\ntypes.\n\n</details>\n\n<details>\n<summary>Backporting guidance</summary>\n\nApplied `backport:version` with `v9.5.0`, `v9.4.5`, and `v9.3.9`. The\n`announceOnMount` root cause was introduced by #235054 (`v9.3.0`), and\nthe test file exists unchanged on the `9.5`, `9.4`, and `9.3` release\nbranches, so the patch applies there cleanly. The `8.19` branch predates\n`announceOnMount` (no duplicate copy, no flake), so it is excluded.\n\n</details>\n\n> [!NOTE]\n> Share feedback in #kibana-qa. Mention `@copilot` to make quick\nchanges.\n\n\n\n\n> Generated by [Flaky Test\nFixer](https://github.com/elastic/kibana/actions/runs/30081512525) for\n#280686 · 229.9 AIC · ⌖ 11.5 AIC · ⊞ 672 ·\n[◷](https://github.com/search?q=repo%3Aelastic%2Fkibana+%22gh-aw-workflow-id%3A+flaky-test-fixer%22&type=pullrequests)\n\n\n\n\n\n\nCo-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>","sha":"d4e18e0234335731ba442786ac02c05f0bc84480","branchLabelMapping":{"^v9.6.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","v9.5.0","flaky-test-fixer","flaky-fix-check:skipped","v9.6.0","v9.4.5","v9.3.9"],"title":"[ML] Fix flaky source_selection test by asserting against the visible callout copy","number":280705,"url":"https://github.com/elastic/kibana/pull/280705","mergeCommit":{"message":"[ML] Fix flaky source_selection test by asserting against the visible callout copy (#280705)\n\nFixes #280686 - likely introduced by #235054 (cc `@paulinashakirova`)\n\n### Summary\n\n- The `analyticsCreateSourceIndexModalCcsErrorCallOut` callout is\nrendered with `announceOnMount`, so EUI mounts a screen-reader\n`role=\"status\"` copy of the title (and body) alongside the visible copy.\n- Three positive assertions used single-match `queryByText(...)`, which\nthrows `Found multiple elements` whenever the SR copy is present — a\ntiming-dependent flake.\n- This patch switches those three assertions to `getAllByText(...)[0]`,\nasserting against the visible copy (which precedes the live-region copy\nin the DOM). No production change — `announceOnMount` is intended a11y\nbehavior.\n\n### Context\n\n- Follows the [failed-test investigator's proposed\nfix](https://github.com/elastic/kibana/issues/280686#issuecomment-5068150163)\nexactly (the already-merged `getAllByText(...)[0]` pattern from\n#269061).\n- Failure was on `main` in the `kibana-on-merge` Jest lane ([build\n103893](https://buildkite.com/elastic/kibana-on-merge/builds/103893#019f9342-9398-4616-9954-22fbe43a9695));\nthe `announceOnMount` copy is populated on a `setTimeout`, so whether\nthe duplicate exists when the assertion runs is a race.\n- Also fixes the identical title+body assertions in the sibling test\n(subject of #254968), which carry the same bug.\n\n<details>\n<summary>Verification</summary>\n\n#### Verified locally\n\n- `✅ Passed: node scripts/eslint\nx-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx`\n- `✅ Passed: node scripts/jest\nx-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx`\n— all 5 tests pass\n\n#### Not verified locally\n\n- `node scripts/type_check --project\nx-pack/platform/plugins/shared/ml/tsconfig.json` was killed by the\nsandbox's memory limit (SIGKILL) before completing, twice. The change is\na test-only edit using standard `@testing-library/react` APIs\n(`getAllByText(...)[0]` returns an `HTMLElement`) and introduces no new\ntypes.\n\n</details>\n\n<details>\n<summary>Backporting guidance</summary>\n\nApplied `backport:version` with `v9.5.0`, `v9.4.5`, and `v9.3.9`. The\n`announceOnMount` root cause was introduced by #235054 (`v9.3.0`), and\nthe test file exists unchanged on the `9.5`, `9.4`, and `9.3` release\nbranches, so the patch applies there cleanly. The `8.19` branch predates\n`announceOnMount` (no duplicate copy, no flake), so it is excluded.\n\n</details>\n\n> [!NOTE]\n> Share feedback in #kibana-qa. Mention `@copilot` to make quick\nchanges.\n\n\n\n\n> Generated by [Flaky Test\nFixer](https://github.com/elastic/kibana/actions/runs/30081512525) for\n#280686 · 229.9 AIC · ⌖ 11.5 AIC · ⊞ 672 ·\n[◷](https://github.com/search?q=repo%3Aelastic%2Fkibana+%22gh-aw-workflow-id%3A+flaky-test-fixer%22&type=pullrequests)\n\n\n\n\n\n\nCo-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>","sha":"d4e18e0234335731ba442786ac02c05f0bc84480"}},"sourceBranch":"main","suggestedTargetBranches":["9.5","9.4","9.3"],"targetPullRequestStates":[{"branch":"9.5","label":"v9.5.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.6.0","branchLabelMappingKey":"^v9.6.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/280705","number":280705,"mergeCommit":{"message":"[ML] Fix flaky source_selection test by asserting against the visible callout copy (#280705)\n\nFixes #280686 - likely introduced by #235054 (cc `@paulinashakirova`)\n\n### Summary\n\n- The `analyticsCreateSourceIndexModalCcsErrorCallOut` callout is\nrendered with `announceOnMount`, so EUI mounts a screen-reader\n`role=\"status\"` copy of the title (and body) alongside the visible copy.\n- Three positive assertions used single-match `queryByText(...)`, which\nthrows `Found multiple elements` whenever the SR copy is present — a\ntiming-dependent flake.\n- This patch switches those three assertions to `getAllByText(...)[0]`,\nasserting against the visible copy (which precedes the live-region copy\nin the DOM). No production change — `announceOnMount` is intended a11y\nbehavior.\n\n### Context\n\n- Follows the [failed-test investigator's proposed\nfix](https://github.com/elastic/kibana/issues/280686#issuecomment-5068150163)\nexactly (the already-merged `getAllByText(...)[0]` pattern from\n#269061).\n- Failure was on `main` in the `kibana-on-merge` Jest lane ([build\n103893](https://buildkite.com/elastic/kibana-on-merge/builds/103893#019f9342-9398-4616-9954-22fbe43a9695));\nthe `announceOnMount` copy is populated on a `setTimeout`, so whether\nthe duplicate exists when the assertion runs is a race.\n- Also fixes the identical title+body assertions in the sibling test\n(subject of #254968), which carry the same bug.\n\n<details>\n<summary>Verification</summary>\n\n#### Verified locally\n\n- `✅ Passed: node scripts/eslint\nx-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx`\n- `✅ Passed: node scripts/jest\nx-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx`\n— all 5 tests pass\n\n#### Not verified locally\n\n- `node scripts/type_check --project\nx-pack/platform/plugins/shared/ml/tsconfig.json` was killed by the\nsandbox's memory limit (SIGKILL) before completing, twice. The change is\na test-only edit using standard `@testing-library/react` APIs\n(`getAllByText(...)[0]` returns an `HTMLElement`) and introduces no new\ntypes.\n\n</details>\n\n<details>\n<summary>Backporting guidance</summary>\n\nApplied `backport:version` with `v9.5.0`, `v9.4.5`, and `v9.3.9`. The\n`announceOnMount` root cause was introduced by #235054 (`v9.3.0`), and\nthe test file exists unchanged on the `9.5`, `9.4`, and `9.3` release\nbranches, so the patch applies there cleanly. The `8.19` branch predates\n`announceOnMount` (no duplicate copy, no flake), so it is excluded.\n\n</details>\n\n> [!NOTE]\n> Share feedback in #kibana-qa. Mention `@copilot` to make quick\nchanges.\n\n\n\n\n> Generated by [Flaky Test\nFixer](https://github.com/elastic/kibana/actions/runs/30081512525) for\n#280686 · 229.9 AIC · ⌖ 11.5 AIC · ⊞ 672 ·\n[◷](https://github.com/search?q=repo%3Aelastic%2Fkibana+%22gh-aw-workflow-id%3A+flaky-test-fixer%22&type=pullrequests)\n\n\n\n\n\n\nCo-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>","sha":"d4e18e0234335731ba442786ac02c05f0bc84480"}},{"branch":"9.4","label":"v9.4.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.3","label":"v9.3.9","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
kibanamachine
added a commit
that referenced
this pull request
Jul 24, 2026
…isible callout copy (#280705) (#280874) # Backport This will backport the following commits from `main` to `9.4`: - [[ML] Fix flaky source_selection test by asserting against the visible callout copy (#280705)](#280705) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Kibana Machine","email":"42973632+kibanamachine@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-07-24T18:35:13Z","message":"[ML] Fix flaky source_selection test by asserting against the visible callout copy (#280705)\n\nFixes #280686 - likely introduced by #235054 (cc `@paulinashakirova`)\n\n### Summary\n\n- The `analyticsCreateSourceIndexModalCcsErrorCallOut` callout is\nrendered with `announceOnMount`, so EUI mounts a screen-reader\n`role=\"status\"` copy of the title (and body) alongside the visible copy.\n- Three positive assertions used single-match `queryByText(...)`, which\nthrows `Found multiple elements` whenever the SR copy is present — a\ntiming-dependent flake.\n- This patch switches those three assertions to `getAllByText(...)[0]`,\nasserting against the visible copy (which precedes the live-region copy\nin the DOM). No production change — `announceOnMount` is intended a11y\nbehavior.\n\n### Context\n\n- Follows the [failed-test investigator's proposed\nfix](https://github.com/elastic/kibana/issues/280686#issuecomment-5068150163)\nexactly (the already-merged `getAllByText(...)[0]` pattern from\n#269061).\n- Failure was on `main` in the `kibana-on-merge` Jest lane ([build\n103893](https://buildkite.com/elastic/kibana-on-merge/builds/103893#019f9342-9398-4616-9954-22fbe43a9695));\nthe `announceOnMount` copy is populated on a `setTimeout`, so whether\nthe duplicate exists when the assertion runs is a race.\n- Also fixes the identical title+body assertions in the sibling test\n(subject of #254968), which carry the same bug.\n\n<details>\n<summary>Verification</summary>\n\n#### Verified locally\n\n- `✅ Passed: node scripts/eslint\nx-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx`\n- `✅ Passed: node scripts/jest\nx-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx`\n— all 5 tests pass\n\n#### Not verified locally\n\n- `node scripts/type_check --project\nx-pack/platform/plugins/shared/ml/tsconfig.json` was killed by the\nsandbox's memory limit (SIGKILL) before completing, twice. The change is\na test-only edit using standard `@testing-library/react` APIs\n(`getAllByText(...)[0]` returns an `HTMLElement`) and introduces no new\ntypes.\n\n</details>\n\n<details>\n<summary>Backporting guidance</summary>\n\nApplied `backport:version` with `v9.5.0`, `v9.4.5`, and `v9.3.9`. The\n`announceOnMount` root cause was introduced by #235054 (`v9.3.0`), and\nthe test file exists unchanged on the `9.5`, `9.4`, and `9.3` release\nbranches, so the patch applies there cleanly. The `8.19` branch predates\n`announceOnMount` (no duplicate copy, no flake), so it is excluded.\n\n</details>\n\n> [!NOTE]\n> Share feedback in #kibana-qa. Mention `@copilot` to make quick\nchanges.\n\n\n\n\n> Generated by [Flaky Test\nFixer](https://github.com/elastic/kibana/actions/runs/30081512525) for\n#280686 · 229.9 AIC · ⌖ 11.5 AIC · ⊞ 672 ·\n[◷](https://github.com/search?q=repo%3Aelastic%2Fkibana+%22gh-aw-workflow-id%3A+flaky-test-fixer%22&type=pullrequests)\n\n\n\n\n\n\nCo-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>","sha":"d4e18e0234335731ba442786ac02c05f0bc84480","branchLabelMapping":{"^v9.6.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","v9.5.0","flaky-test-fixer","flaky-fix-check:skipped","v9.6.0","v9.4.5","v9.3.9"],"title":"[ML] Fix flaky source_selection test by asserting against the visible callout copy","number":280705,"url":"https://github.com/elastic/kibana/pull/280705","mergeCommit":{"message":"[ML] Fix flaky source_selection test by asserting against the visible callout copy (#280705)\n\nFixes #280686 - likely introduced by #235054 (cc `@paulinashakirova`)\n\n### Summary\n\n- The `analyticsCreateSourceIndexModalCcsErrorCallOut` callout is\nrendered with `announceOnMount`, so EUI mounts a screen-reader\n`role=\"status\"` copy of the title (and body) alongside the visible copy.\n- Three positive assertions used single-match `queryByText(...)`, which\nthrows `Found multiple elements` whenever the SR copy is present — a\ntiming-dependent flake.\n- This patch switches those three assertions to `getAllByText(...)[0]`,\nasserting against the visible copy (which precedes the live-region copy\nin the DOM). No production change — `announceOnMount` is intended a11y\nbehavior.\n\n### Context\n\n- Follows the [failed-test investigator's proposed\nfix](https://github.com/elastic/kibana/issues/280686#issuecomment-5068150163)\nexactly (the already-merged `getAllByText(...)[0]` pattern from\n#269061).\n- Failure was on `main` in the `kibana-on-merge` Jest lane ([build\n103893](https://buildkite.com/elastic/kibana-on-merge/builds/103893#019f9342-9398-4616-9954-22fbe43a9695));\nthe `announceOnMount` copy is populated on a `setTimeout`, so whether\nthe duplicate exists when the assertion runs is a race.\n- Also fixes the identical title+body assertions in the sibling test\n(subject of #254968), which carry the same bug.\n\n<details>\n<summary>Verification</summary>\n\n#### Verified locally\n\n- `✅ Passed: node scripts/eslint\nx-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx`\n- `✅ Passed: node scripts/jest\nx-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx`\n— all 5 tests pass\n\n#### Not verified locally\n\n- `node scripts/type_check --project\nx-pack/platform/plugins/shared/ml/tsconfig.json` was killed by the\nsandbox's memory limit (SIGKILL) before completing, twice. The change is\na test-only edit using standard `@testing-library/react` APIs\n(`getAllByText(...)[0]` returns an `HTMLElement`) and introduces no new\ntypes.\n\n</details>\n\n<details>\n<summary>Backporting guidance</summary>\n\nApplied `backport:version` with `v9.5.0`, `v9.4.5`, and `v9.3.9`. The\n`announceOnMount` root cause was introduced by #235054 (`v9.3.0`), and\nthe test file exists unchanged on the `9.5`, `9.4`, and `9.3` release\nbranches, so the patch applies there cleanly. The `8.19` branch predates\n`announceOnMount` (no duplicate copy, no flake), so it is excluded.\n\n</details>\n\n> [!NOTE]\n> Share feedback in #kibana-qa. Mention `@copilot` to make quick\nchanges.\n\n\n\n\n> Generated by [Flaky Test\nFixer](https://github.com/elastic/kibana/actions/runs/30081512525) for\n#280686 · 229.9 AIC · ⌖ 11.5 AIC · ⊞ 672 ·\n[◷](https://github.com/search?q=repo%3Aelastic%2Fkibana+%22gh-aw-workflow-id%3A+flaky-test-fixer%22&type=pullrequests)\n\n\n\n\n\n\nCo-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>","sha":"d4e18e0234335731ba442786ac02c05f0bc84480"}},"sourceBranch":"main","suggestedTargetBranches":["9.5","9.4","9.3"],"targetPullRequestStates":[{"branch":"9.5","label":"v9.5.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.6.0","branchLabelMappingKey":"^v9.6.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/280705","number":280705,"mergeCommit":{"message":"[ML] Fix flaky source_selection test by asserting against the visible callout copy (#280705)\n\nFixes #280686 - likely introduced by #235054 (cc `@paulinashakirova`)\n\n### Summary\n\n- The `analyticsCreateSourceIndexModalCcsErrorCallOut` callout is\nrendered with `announceOnMount`, so EUI mounts a screen-reader\n`role=\"status\"` copy of the title (and body) alongside the visible copy.\n- Three positive assertions used single-match `queryByText(...)`, which\nthrows `Found multiple elements` whenever the SR copy is present — a\ntiming-dependent flake.\n- This patch switches those three assertions to `getAllByText(...)[0]`,\nasserting against the visible copy (which precedes the live-region copy\nin the DOM). No production change — `announceOnMount` is intended a11y\nbehavior.\n\n### Context\n\n- Follows the [failed-test investigator's proposed\nfix](https://github.com/elastic/kibana/issues/280686#issuecomment-5068150163)\nexactly (the already-merged `getAllByText(...)[0]` pattern from\n#269061).\n- Failure was on `main` in the `kibana-on-merge` Jest lane ([build\n103893](https://buildkite.com/elastic/kibana-on-merge/builds/103893#019f9342-9398-4616-9954-22fbe43a9695));\nthe `announceOnMount` copy is populated on a `setTimeout`, so whether\nthe duplicate exists when the assertion runs is a race.\n- Also fixes the identical title+body assertions in the sibling test\n(subject of #254968), which carry the same bug.\n\n<details>\n<summary>Verification</summary>\n\n#### Verified locally\n\n- `✅ Passed: node scripts/eslint\nx-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx`\n- `✅ Passed: node scripts/jest\nx-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx`\n— all 5 tests pass\n\n#### Not verified locally\n\n- `node scripts/type_check --project\nx-pack/platform/plugins/shared/ml/tsconfig.json` was killed by the\nsandbox's memory limit (SIGKILL) before completing, twice. The change is\na test-only edit using standard `@testing-library/react` APIs\n(`getAllByText(...)[0]` returns an `HTMLElement`) and introduces no new\ntypes.\n\n</details>\n\n<details>\n<summary>Backporting guidance</summary>\n\nApplied `backport:version` with `v9.5.0`, `v9.4.5`, and `v9.3.9`. The\n`announceOnMount` root cause was introduced by #235054 (`v9.3.0`), and\nthe test file exists unchanged on the `9.5`, `9.4`, and `9.3` release\nbranches, so the patch applies there cleanly. The `8.19` branch predates\n`announceOnMount` (no duplicate copy, no flake), so it is excluded.\n\n</details>\n\n> [!NOTE]\n> Share feedback in #kibana-qa. Mention `@copilot` to make quick\nchanges.\n\n\n\n\n> Generated by [Flaky Test\nFixer](https://github.com/elastic/kibana/actions/runs/30081512525) for\n#280686 · 229.9 AIC · ⌖ 11.5 AIC · ⊞ 672 ·\n[◷](https://github.com/search?q=repo%3Aelastic%2Fkibana+%22gh-aw-workflow-id%3A+flaky-test-fixer%22&type=pullrequests)\n\n\n\n\n\n\nCo-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>","sha":"d4e18e0234335731ba442786ac02c05f0bc84480"}},{"branch":"9.4","label":"v9.4.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.3","label":"v9.3.9","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Fixes #280686 - likely introduced by #235054 (cc
@paulinashakirova)Summary
analyticsCreateSourceIndexModalCcsErrorCallOutcallout is rendered withannounceOnMount, so EUI mounts a screen-readerrole="status"copy of the title (and body) alongside the visible copy.queryByText(...), which throwsFound multiple elementswhenever the SR copy is present — a timing-dependent flake.getAllByText(...)[0], asserting against the visible copy (which precedes the live-region copy in the DOM). No production change —announceOnMountis intended a11y behavior.Context
getAllByText(...)[0]pattern from Fixes failing test in share to space flyout #269061).mainin thekibana-on-mergeJest lane (build 103893); theannounceOnMountcopy is populated on asetTimeout, so whether the duplicate exists when the assertion runs is a race.Verification
Verified locally
✅ Passed: node scripts/eslint x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx✅ Passed: node scripts/jest x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx— all 5 tests passNot verified locally
node scripts/type_check --project x-pack/platform/plugins/shared/ml/tsconfig.jsonwas killed by the sandbox's memory limit (SIGKILL) before completing, twice. The change is a test-only edit using standard@testing-library/reactAPIs (getAllByText(...)[0]returns anHTMLElement) and introduces no new types.Backporting guidance
Applied
backport:versionwithv9.5.0,v9.4.5, andv9.3.9. TheannounceOnMountroot cause was introduced by #235054 (v9.3.0), and the test file exists unchanged on the9.5,9.4, and9.3release branches, so the patch applies there cleanly. The8.19branch predatesannounceOnMount(no duplicate copy, no flake), so it is excluded.Note
Share feedback in #kibana-qa. Mention
@copilotto make quick changes.