.macroscope/flaky-test-runner-nudge.md
Decide whether this PR needs a Flaky Test Runner nudge. If not, post nothing.
Important:
(runner type, config path) tokens that is a subset of, or equal to, what any prior comment already covers → post nothing.**/test/scout*/**src/platform/test/**, x-pack/**/test/**If nothing matches, stop.
The required CI pass already catches deterministic failures. The flaky test runner only adds signal when the same change could fail non-deterministically — i.e., when a single pass isn't a reliable signal. Ask one question:
Does this change introduce a new source of non-determinism that one CI pass wouldn't reliably catch?
If no, skip — regardless of how many test files are touched.
Nudge (new non-determinism introduced):
test(...), it(...), new describe blocks) — unknown stability.test.skip → test, .only removed on a previously-skipped suite) — often skipped originally because they were flaky.waitFor, expect.toPass, retry, polling intervals, setTimeout, increased/decreased timeouts, new await on async operations whose ordering matters.beforeEach/afterEach that mutate shared state.Skip (deterministic — one pass is sufficient):
expect(x).toBe(1) → expect(x).toBe(2) to match a code change).If you can describe the change as "rename X to Y", "move A to B", or "update expected value from X to Y", and nothing else is going on, skip. A 30-run matrix cannot reveal anything a single run wouldn't.
Evaluate Scout and FTR independently. Only nudge the side(s) that qualify.
FTR: Walk up from the changed file and collect all leaf config*.ts files (skip *.base.ts). For each candidate, use browse_code to verify it actually references the changed file via testFiles or loadTestFile (directly or via glob). Only include configs that pass this check. If no candidate is found walking up, use browse_code to search for which config includes the changed file.
Example: x-pack/platform/test/serverless/functional/configs/search/config.group7.ts
Scout: Walk up from the changed file to the nearest playwright.config.ts or parallel.playwright.config.ts (prefer parallel if the path contains parallel_tests/). Verify the config actually runs the changed file.
Example: x-pack/platform/plugins/shared/streams_app/test/scout/ui/playwright.config.ts
If multiple changed files resolve to the same config, include it only once.
A shared fixture is a non-test file (XML, JSON archive, ES/Kibana snapshot, role definition, etc.) that is not referenced by testFiles / loadTestFile, is pulled in only by *.base.ts configs (typically via require.resolve or import), and is consumed identically by every leaf config that extends the base (e.g. loaded once at server startup).
When the changed file is a shared fixture:
@kbn/security-api-integration-helpers/saml/idp_metadata_mock_idp.xml, prefer x-pack/platform/test/api_integration_deployment_agnostic/configs/stateful/platform.stateful.config.ts over siblings that layer on feature flags or solution-specific services.Post one comment on the PR with a single /flaky command. Include tokens only for runner types that qualify. All configs — any number, any mix of Scout and FTR — go space-separated on the same line. Format:
**Catch flakiness early (recommended)**: run the flaky test runner against this PR before merging.
<!-- optional: one-sentence rationale, see "Rationale line" below -->
Trigger a run with the [Flaky Test Runner UI](https://ci-stats.kibana.dev/trigger_flaky_test_runner) or post this comment on the PR:
```
/flaky <type>:<path>:30 [<type>:<path>:30 ...]
```
<sup>Share feedback in the [#appex-qa](https://elastic.slack.com/archives/C04HT4P1YS3) channel.</sup>
Include a one-sentence rationale immediately below the recommendation line whenever the mapping from changed files → config(s) is not self-evident. Keep it to a single sentence; do not list every file.
Include a rationale when any of these hold:
unskip, a parallelism/config change).test/** path (prod code that a specific config exercises).Skip the rationale when a single changed spec file maps to a single obvious config under the same directory — the path already tells the story.
Rationale examples (pick the shape that fits):
Covers the new Scout spec at <path> added in this PR.<path> is a shared fixture loaded by <base config>; this leaf is the canonical vanilla config exercising the same runtime path.<path> is referenced by both configs below via loadTestFile.This PR unskips a previously-flaky test in <config>, so re-running it 30× validates stability.Examples:
Scout-only:
/flaky scoutConfig:x-pack/platform/plugins/shared/streams_app/test/scout/ui/playwright.config.ts:30
FTR-only (multiple configs):
/flaky ftrConfig:x-pack/platform/test/serverless/functional/configs/search/config.group7.ts:30 ftrConfig:x-pack/platform/test/serverless/functional/configs/search/config.group8.ts:30
Mixed Scout + FTR:
/flaky scoutConfig:x-pack/platform/plugins/shared/streams_app/test/scout/ui/playwright.config.ts:30 ftrConfig:x-pack/platform/test/serverless/functional/configs/search/config.group7.ts:30 ftrConfig:x-pack/platform/test/serverless/functional/configs/search/config.group8.ts:30
Rules:
:30 on every token./flaky line — never multiple.> ⚠️ Could not resolve a config for [Scout/FTR] — please identify the correct config path and run manually via the [Flaky Test Runner UI](https://ci-stats.kibana.dev/trigger_flaky_test_runner).