Skip to content

[9.4] [SLO] Wait for rollup data before asserting burn-rate rule is active (#289553) - #290673

Merged
kibanamachine merged 1 commit into
elastic:9.4from
kibanamachine:backport/9.4/pr-289553
Sep 11, 2026
Merged

[9.4] [SLO] Wait for rollup data before asserting burn-rate rule is active (#289553)#290673
kibanamachine merged 1 commit into
elastic:9.4from
kibanamachine:backport/9.4/pr-289553

Conversation

@kibanamachine

Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.4:

Questions ?

Please refer to the Backport tool documentation

…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)
@kibanamachine kibanamachine self-assigned this Sep 11, 2026
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Sep 11, 2026
@kibanamachine
kibanamachine enabled auto-merge (squash) September 11, 2026 20:17
@kibanamachine

Copy link
Copy Markdown
Contributor Author

💚 Build Succeeded

Metrics [docs]

✅ unchanged

cc @kibanamachine

@kibanamachine
kibanamachine merged commit c54b742 into elastic:9.4 Sep 11, 2026
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant