Skip to content

[Security Solution] [Detections] Fix flakey EQL shard test#215757

Merged
dhurley14 merged 15 commits intoelastic:mainfrom
dhurley14:fix-skipped-shard-eql-test
Mar 28, 2025
Merged

[Security Solution] [Detections] Fix flakey EQL shard test#215757
dhurley14 merged 15 commits intoelastic:mainfrom
dhurley14:fix-skipped-shard-eql-test

Conversation

@dhurley14
Copy link
Copy Markdown
Contributor

@dhurley14 dhurley14 commented Mar 24, 2025

Summary

Ref: #209024

Flake caused by occasionally hitting max signals on the "good" shard and never triggering the error from the runtime field on the "bad" shard. By moving the bad runtime field to the packetbeat index and changing the rule query in the test to an and we can ensure the rule queries both good and bad shards.

Checklist

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#8095

[❌] x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/eql/trial_license_complete_tier/configs/ess.config.ts: 25/51 tests passed.

see run history

@dhurley14 dhurley14 changed the title force refresh on scripted field [Security Solution] [Detections] Fix flakey EQL shard test Mar 24, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#8096

[✅] x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/eql/trial_license_complete_tier/configs/ess.config.ts: 51/51 tests passed.

see run history

@dhurley14 dhurley14 self-assigned this Mar 24, 2025
@dhurley14 dhurley14 added review release_note:skip Skip the PR/issue when compiling release notes Team:Detection Engine Security Solution Detection Engine Area backport:version Backport to applied version labels labels Mar 24, 2025
@dhurley14 dhurley14 marked this pull request as ready for review March 24, 2025 23:20
@dhurley14 dhurley14 requested review from a team as code owners March 24, 2025 23:20
@dhurley14 dhurley14 requested a review from nkhristinin March 24, 2025 23:20
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-detection-engine (Team:Detection Engine)

import url from 'url';
import expect from '@kbn/expect';
import { default as kbnExpect } from '@kbn/expect';
import expect from 'expect';
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should migrate away from @kbn/expect towards the expect library: #215165

Comment on lines +264 to +274
expect(logs).toEqual(
expect.arrayContaining([
expect.objectContaining({
warnings: expect.arrayContaining([
expect.stringContaining(
'The EQL event query was only executed on the available shards. The query failed to run successfully on the following shards:'
),
]),
}),
])
);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc: @rylnd I am using the other expect library here. Thanks for the suggestion!

Copy link
Copy Markdown
Contributor

@nkhristinin nkhristinin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I think it make sense to also run flaky test runner for this PR, to be sure that it working

@dhurley14
Copy link
Copy Markdown
Contributor Author

Flakey test runner passed here ✅ #215757 (comment) But I will run it again just to double check!

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#8119

[✅] x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/eql/trial_license_complete_tier/configs/ess.config.ts: 51/51 tests passed.

see run history

@dhurley14 dhurley14 enabled auto-merge (squash) March 28, 2025 18:20
@dhurley14 dhurley14 merged commit d869d47 into elastic:main Mar 28, 2025
15 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.0

https://github.com/elastic/kibana/actions/runs/14135827351

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

cc @dhurley14

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
9.0 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 215757

Questions ?

Please refer to the Backport tool documentation

@dhurley14
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
9.0

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

dhurley14 added a commit to dhurley14/kibana that referenced this pull request Mar 28, 2025
…15757)

## Summary

Ref: elastic#209024

Flake caused by occasionally hitting max signals on the "good" shard and
never triggering the error from the runtime field on the "bad" shard. By
moving the bad runtime field to the `packetbeat` index and changing the
rule query in the test to an `and` we can ensure the rule queries both
good and bad shards.

### Checklist

- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

(cherry picked from commit d869d47)

# Conflicts:
#	x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/eql/trial_license_complete_tier/eql.ts
dhurley14 added a commit that referenced this pull request Mar 28, 2025
…5757) (#216375)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Security Solution] [Detections] Fix flakey EQL shard test
(#215757)](#215757)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Devin W.
Hurley","email":"devin.hurley@elastic.co"},"sourceCommit":{"committedDate":"2025-03-28T18:47:15Z","message":"[Security
Solution] [Detections] Fix flakey EQL shard test (#215757)\n\n##
Summary\n\nRef: https://github.com/elastic/kibana/issues/209024\n\nFlake
caused by occasionally hitting max signals on the \"good\" shard
and\nnever triggering the error from the runtime field on the \"bad\"
shard. By\nmoving the bad runtime field to the `packetbeat` index and
changing the\nrule query in the test to an `and` we can ensure the rule
queries both\ngood and bad shards.\n\n### Checklist\n\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed","sha":"d869d472f0b9b55c635580c4d7d15faff8b8c215","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["review","release_note:skip","v9.0.0","Team:Detection
Engine","backport:version","v9.1.0","v9.0.1"],"title":"[Security
Solution] [Detections] Fix flakey EQL shard
test","number":215757,"url":"https://github.com/elastic/kibana/pull/215757","mergeCommit":{"message":"[Security
Solution] [Detections] Fix flakey EQL shard test (#215757)\n\n##
Summary\n\nRef: https://github.com/elastic/kibana/issues/209024\n\nFlake
caused by occasionally hitting max signals on the \"good\" shard
and\nnever triggering the error from the runtime field on the \"bad\"
shard. By\nmoving the bad runtime field to the `packetbeat` index and
changing the\nrule query in the test to an `and` we can ensure the rule
queries both\ngood and bad shards.\n\n### Checklist\n\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed","sha":"d869d472f0b9b55c635580c4d7d15faff8b8c215"}},"sourceBranch":"main","suggestedTargetBranches":["9.0"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/215757","number":215757,"mergeCommit":{"message":"[Security
Solution] [Detections] Fix flakey EQL shard test (#215757)\n\n##
Summary\n\nRef: https://github.com/elastic/kibana/issues/209024\n\nFlake
caused by occasionally hitting max signals on the \"good\" shard
and\nnever triggering the error from the runtime field on the \"bad\"
shard. By\nmoving the bad runtime field to the `packetbeat` index and
changing the\nrule query in the test to an `and` we can ensure the rule
queries both\ngood and bad shards.\n\n### Checklist\n\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed","sha":"d869d472f0b9b55c635580c4d7d15faff8b8c215"}}]}]
BACKPORT-->
cqliu1 pushed a commit to cqliu1/kibana that referenced this pull request Mar 31, 2025
…15757)

## Summary

Ref: elastic#209024

Flake caused by occasionally hitting max signals on the "good" shard and
never triggering the error from the runtime field on the "bad" shard. By
moving the bad runtime field to the `packetbeat` index and changing the
rule query in the test to an `and` we can ensure the rule queries both
good and bad shards.

### Checklist

- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
rylnd added a commit to rylnd/kibana that referenced this pull request Aug 12, 2025
These changes are somewhat at odds with what was done in elastic#215757, which
was not backported to 8.19.
@rylnd
Copy link
Copy Markdown
Contributor

rylnd commented Aug 29, 2025

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

rylnd pushed a commit to rylnd/kibana that referenced this pull request Aug 29, 2025
…15757)

## Summary

Ref: elastic#209024

Flake caused by occasionally hitting max signals on the "good" shard and
never triggering the error from the runtime field on the "bad" shard. By
moving the bad runtime field to the `packetbeat` index and changing the
rule query in the test to an `and` we can ensure the rule queries both
good and bad shards.

### Checklist

- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

(cherry picked from commit d869d47)

# Conflicts:
#	x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/eql/trial_license_complete_tier/eql.ts
rylnd added a commit to rylnd/kibana that referenced this pull request Aug 29, 2025
These look to have been modified in elastic#215757 due to what looks like a bad
find/replace; when I backported those changes to 8.19 I also 'ported
these mistakes 😅
rylnd added a commit that referenced this pull request Aug 29, 2025
…15757) (#233535)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Security Solution] [Detections] Fix flakey EQL shard test
(#215757)](#215757)
 
Closes #209024; details can be
found there.

<!--- Backport version: 10.0.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Devin W.
Hurley","email":"devin.hurley@elastic.co"},"sourceCommit":{"committedDate":"2025-03-28T18:47:15Z","message":"[Security
Solution] [Detections] Fix flakey EQL shard test (#215757)\n\n##
Summary\n\nRef: https://github.com/elastic/kibana/issues/209024\n\nFlake
caused by occasionally hitting max signals on the \"good\" shard
and\nnever triggering the error from the runtime field on the \"bad\"
shard. By\nmoving the bad runtime field to the `packetbeat` index and
changing the\nrule query in the test to an `and` we can ensure the rule
queries both\ngood and bad shards.\n\n### Checklist\n\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed","sha":"d869d472f0b9b55c635580c4d7d15faff8b8c215","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["review","release_note:skip","v9.0.0","Team:Detection
Engine","backport:version","v9.1.0","v9.0.1"],"title":"[Security
Solution] [Detections] Fix flakey EQL shard
test","number":215757,"url":"https://github.com/elastic/kibana/pull/215757","mergeCommit":{"message":"[Security
Solution] [Detections] Fix flakey EQL shard test (#215757)\n\n##
Summary\n\nRef: https://github.com/elastic/kibana/issues/209024\n\nFlake
caused by occasionally hitting max signals on the \"good\" shard
and\nnever triggering the error from the runtime field on the \"bad\"
shard. By\nmoving the bad runtime field to the `packetbeat` index and
changing the\nrule query in the test to an `and` we can ensure the rule
queries both\ngood and bad shards.\n\n### Checklist\n\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed","sha":"d869d472f0b9b55c635580c4d7d15faff8b8c215"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/216375","number":216375,"state":"MERGED","mergeCommit":{"sha":"a2002e0bd3692dd9dfeca80d0dbc38dd3a2af18a","message":"[9.0]
[Security Solution] [Detections] Fix flakey EQL shard test (#215757)
(#216375)\n\n# Backport\n\nThis will backport the following commits from
`main` to `9.0`:\n- [[Security Solution] [Detections] Fix flakey EQL
shard
test\n(#215757)](https://github.com/elastic/kibana/pull/215757)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n"}},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/215757","number":215757,"mergeCommit":{"message":"[Security
Solution] [Detections] Fix flakey EQL shard test (#215757)\n\n##
Summary\n\nRef: https://github.com/elastic/kibana/issues/209024\n\nFlake
caused by occasionally hitting max signals on the \"good\" shard
and\nnever triggering the error from the runtime field on the \"bad\"
shard. By\nmoving the bad runtime field to the `packetbeat` index and
changing the\nrule query in the test to an `and` we can ensure the rule
queries both\ngood and bad shards.\n\n### Checklist\n\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed","sha":"d869d472f0b9b55c635580c4d7d15faff8b8c215"}}]}]
BACKPORT-->

---------

Co-authored-by: Devin W. Hurley <devin.hurley@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes review Team:Detection Engine Security Solution Detection Engine Area v8.19.4 v9.0.0 v9.0.1 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants