[9.4] [SLO] Wait for rollup data before asserting burn-rate rule is active (#289553) - #290673
Merged
Merged
Conversation
…lastic#289553) Fixes elastic#288092 ### Summary - The `Burn rate rule - consumers and privileges` API integration test failed at the `active`-state assertions, timing out after 120s with `waitForStatus(active): got ok`. - The burn-rate rule evaluates SLI rollup data filtered by `slo.id`; until the SLO's rollup transform writes a document for that `sloId`, the rule runs against no data and reports `execution_status.status: 'ok'`. The test asserted `active` with no wait for that rollup, so the poll raced the 1-minute scheduler and the rollup transform. - This patch adds a per-block helper that waits for a rollup document for the SLO in the SLI destination index, then forces one rule run so the breach is detected deterministically. It is called once after each of the four rule-creating blocks. ### Context - Follows the failed-test investigator's [proposed fix](elastic#288092 (comment)) (posted 2026-09-07): wait on the rule's readiness signal — an SLI rollup doc for the current `sloId` — then force an evaluation, rather than bumping a timeout or tolerating the failure. The wait is a bounded poll of a *read* plus a documented `_run_soon`, not a retry of an action. - The same rollup-wait + forced-run fix was applied to the sibling `burn_rate_rule.ts` in elastic#284847, whose body noted that `consumers_and_privileges` shares the same SLI index but was not patched at the time — this closes that gap. - `got ok` (not `undefined`/403) confirms the slo-only role successfully read the rule, so only the `active`-state readiness raced, not authorization. - Failures were on `main` local pipelines — first [kibana-on-merge elastic#108154](https://buildkite.com/elastic/kibana-on-merge/builds/108154#01a05792-eed7-4811-a5a6-a04527a17611) (2026-08-31), recurring on [kibana-fips elastic#2186](https://buildkite.com/elastic/kibana-fips/builds/2186#01a07b2a-8534-4e65-a227-8839c429acde) (2026-09-07) — pointing at a test defect rather than a Cloud-only environment issue. <details> <summary>Verification</summary> #### Verified locally - ✅ Passed: `node scripts/eslint x-pack/solutions/observability/test/api_integration_deployment_agnostic/apis/alerting/burn_rate/consumers_and_privileges.ts` #### Not verified locally - This is an FTR API integration test that requires a live Elasticsearch + Kibana (serverless Observability deployment-agnostic config), which cannot run in this environment. Its behavior under CI and the exact rollup timing are therefore not verified locally; the PR's CI covers the run. </details> > [!NOTE] > Share feedback in #kibana-qa. Mention `@copilot` to make quick changes. > [!WARNING] > <details> > <summary>Firewall blocked 1 domain</summary> > > The following domain was blocked by the firewall during workflow execution: > > - `api.anthropic.com` > > To allow these domains, add them to the `network.allowed` list in your workflow frontmatter: > > ```yaml > network: > allowed: > - defaults > - "api.anthropic.com" > ``` > > See [Network Configuration](https://github.github.com/gh-aw/reference/network/) for more information. > > </details> > Generated by [Flaky Test Fixer](https://github.com/elastic/kibana/actions/runs/34110807468) for elastic#288092 · claude · opus · 290.2 AIC · ⌖ 40.5 AIC · ⊞ 13.2K · [◷](https://github.com/search?q=repo%3Aelastic%2Fkibana+%22gh-aw-workflow-id%3A+flaky-test-fixer%22&type=pullrequests) <!-- gh-aw-agentic-workflow: Flaky Test Fixer, engine: claude, version: 2.1.165, model: opus, id: 34110807468, workflow_id: flaky-test-fixer, run: https://github.com/elastic/kibana/actions/runs/34110807468 --> <!-- gh-aw-workflow-id: flaky-test-fixer --> <!-- gh-aw-workflow-call-id: elastic/kibana/flaky-test-fixer --> Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit fc2084e)
Contributor
Author
💚 Build Succeeded
Metrics [docs]
|
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.
Backport
This will backport the following commits from
mainto9.4:Questions ?
Please refer to the Backport tool documentation