Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.10] [Security Solution] Fix value lists tests flakiness (#164253) #164324

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.10:

Questions ?

Please refer to the Backport tool documentation

**Fixes:** elastic#164056

## Summary

This PR fixes [value_lists.cy.ts](https://github.com/elastic/kibana/blob/main/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/value_lists/value_lists.cy.ts) tests flakiness.

## The flakiness reason

Value list items are processed in a bulk via bulk creation and `refresh=wait_for` is [used](https://github.com/elastic/kibana/blob/main/x-pack/plugins/lists/server/services/items/create_list_items_bulk.ts#L87). The problem it returns sometimes earlier than data is available. [Bulk API docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html#bulk-refresh) say the following

> Only the shards that receive the bulk request will be affected by refresh. Imagine a _bulk?refresh=wait_for request with three documents in it that happen to be routed to different shards in an index with five shards. The request will only wait for those three shards to refresh. The other two shards that make up the index do not participate in the _bulk request at all.

While (it seems) only one shard is used in tests but it still cause issues (approx. 1 test per 50 fails) so adding explicit index refresh helps to get rid of flakiness.

## Flaky test runner

[value_lists.cy.ts (150 runs)](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2924) 🟢

(cherry picked from commit d34c845)
@kibanamachine kibanamachine merged commit 05efd0c into elastic:8.10 Aug 21, 2023
@kibana-ci
Copy link
Collaborator

kibana-ci commented Aug 21, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #47 / detection engine api security and spaces enabled - Group 4 Detection rule type telemetry Detection rule task telemetry pre-built/immutable/elastic rules should show detection_rules telemetry data for each list type should return mutating types such as "id", "@timestamp", etc... for list of type "detection"
  • [job] [logs] FTR Configs #47 / detection engine api security and spaces enabled - Group 4 Detection rule type telemetry Detection rule task telemetry pre-built/immutable/elastic rules should show detection_rules telemetry data for each list type should return mutating types such as "id", "@timestamp", etc... for list of type "detection"
  • [job] [logs] Security Solution Cypress Tests #1 / Overflow items Network stats and tables Shows Hover actions for more items in the popover Shows Hover actions for more items in the popover

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @maximpn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants