Skip to content

[Observability] Update alert details context test for empty no-params result - #290503

Open
kibanamachine wants to merge 1 commit into
mainfrom
fix/flaky-290496-no-params-empty-context-d3ae1d575ddc29a1
Open

[Observability] Update alert details context test for empty no-params result#290503
kibanamachine wants to merge 1 commit into
mainfrom
fix/flaky-290496-no-params-empty-context-d3ae1d575ddc29a1

Conversation

@kibanamachine

Copy link
Copy Markdown
Contributor

Fixes #290496

Summary

  • The Scout API case returns a single log category when no params are specified asserted expect(alertContext).toHaveLength(1) but received [], failing deterministically on the #290244 merge build.
  • Updates the case to expect an empty context (toStrictEqual([])) and renames it to returns nothing when no params are specified, matching the product's new contract.

Relevant history

Context

  • With no params, serviceName/hostName/containerId/kubernetesPodName are all undefined, so hasEntityFilters is false; log categories are skipped and the remaining unconditional fetchers return empty data filtered out at index.ts:328, yielding []. The old toHaveLength(1) expectation asserted a log category the product no longer promises — the assertion was the bug, so it is corrected (not weakened), mirroring the existing "non-existing container id" case at L173-L178.
  • This patch follows the failed-test investigator's proposed fix; I independently verified the hasEntityFilters gate and the isEmpty(item.data) filter against current main.
  • Failures: first seen on kibana-on-merge build 109422 (the merge build for [Obs AI Assistant] Skip log rate analysis and log categories when no entity filters are present #290244) on both the local-serverless-observability_complete and local-stateful-classic targets.
Verification

Verified locally

  • ✅ Passed: node scripts/eslint x-pack/solutions/observability/plugins/observability/test/scout/api/tests/alert_details_context_logs_without_service_name.spec.ts

Not verified locally

  • Scout API tests require a live Elasticsearch + Kibana stack, which cannot be run in this environment; the PR's CI covers the actual run.

Note

Share feedback in #kibana-qa. Mention @copilot to make quick changes.

Generated by Flaky Test Fixer for #290496 · claude · opus · 162.3 AIC · ⌖ 40.5 AIC · ⊞ 14.5K ·

Update the "no params" case to expect an empty context, matching the
hasEntityFilters gate added in #290244.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown
🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!
  • Click to trigger kibana-entity-store-performance-from-pr for this PR!
  • Click to trigger kibana-storybooks-from-pr for this PR!

@github-actions github-actions Bot added backport:skip This PR does not require backporting flaky-fix-check:skipped Flaky fix verifier: runner can't verify this fix (e.g. no Jest support) release_note:skip Skip the PR/issue when compiling release notes labels Sep 11, 2026
@kibanamachine

Copy link
Copy Markdown
Contributor Author

⏭️ Flaky-fix verification skipped

The failure is deterministic: #290244 added a hasEntityFilters gate so a no-params request now returns an empty context, and this fix correctly updates the stale toHaveLength(1) assertion to toStrictEqual([]) to match. Repeated flaky-runner runs can't add signal over the required Scout API CI for a deterministic assertion correction, so the runner was skipped. Applied release_note:skip and backport:skip.

Why the flaky test runner wasn't used

The /flaky runner only adds signal when a fix mitigates a non-deterministic cause (a race, wait/timeout, ordering, or shared-state timing) whose stability must be confirmed across many runs. This fix instead corrects an assertion that deterministically failed after #290244 changed the product contract (with no entity params, hasEntityFilters is false, so log categories are skipped and the remaining fetchers are filtered out at index.ts:328, yielding []). The required Scout API CI run is therefore a sufficient and complete verdict.

How release-note and backport labels were chosen

Applied release_note:skip because the change only edits a Scout API test spec — no user-facing behavior changes.

Generated by Flaky Fix Verifier for #290503 · claude · opus · 200.3 AIC · ⌖ 42.3 AIC · ⊞ 15.8K ·

@kibanamachine
kibanamachine marked this pull request as ready for review September 11, 2026 10:33
@kibanamachine
kibanamachine requested a review from a team as a code owner September 11, 2026 10:33
@kibanamachine
kibanamachine enabled auto-merge (squash) September 11, 2026 10:33
@kibanamachine kibanamachine added the reviewer:scout Agentic PR Scout test review label Sep 11, 2026
@kibanamachine

kibanamachine commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

💔 Build Failed

Failed CI Steps

Metrics [docs]

✅ unchanged

Test Failures

  • [job] [logs] Scout Lane #2 - serverless-observability_complete / default / local-serverless-observability_complete - Observability alert details context when logs are annotated with service.name - returns no service summary and the service + container log categories when no params are specified
  • [job] [logs] Scout Lane #2 - serverless-observability_complete / default / local-serverless-observability_complete - Observability alert details context when logs are annotated with service.name - returns no service summary and the service + container log categories when no params are specified
  • [job] [logs] Scout Lane #1 - stateful-classic / default / local-stateful-classic - Observability alert details context when logs are annotated with service.name - returns no service summary and the service + container log categories when no params are specified
  • [job] [logs] Scout Lane #1 - stateful-classic / default / local-stateful-classic - Observability alert details context when logs are annotated with service.name - returns no service summary and the service + container log categories when no params are specified

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting flaky-fix-check:skipped Flaky fix verifier: runner can't verify this fix (e.g. no Jest support) flaky-test-fixer Automated PR created by the flaky test fixer workflow release_note:skip Skip the PR/issue when compiling release notes reviewer:scout Agentic PR Scout test review

Projects

None yet

1 participant