Skip to content

[8.19] [Detection Engine] Prevent test data from rolling outside of Cypress rules' query (#220923)#221439

Merged
rylnd merged 2 commits intoelastic:8.19from
rylnd:backport/8.19/pr-220923
May 30, 2025
Merged

[8.19] [Detection Engine] Prevent test data from rolling outside of Cypress rules' query (#220923)#221439
rylnd merged 2 commits intoelastic:8.19from
rylnd:backport/8.19/pr-220923

Conversation

@rylnd
Copy link
Copy Markdown
Contributor

@rylnd rylnd commented May 23, 2025

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

…rules' query (elastic#220923)

## Summary

Our tests rely on static test data, and our cypress suite was running
rules with a large lookback (50000h) against them. Recently, tests have
begun failing because we've exceeded 50000h since the data's
`@timestamp`. This PR updates the cypress rules to use a fixed `from`
field wherever possible, in order to "fix" that query window's starting
point, ensuring that this issue does not recur. This is already how our
integration tests are creating similar rules, so as an added bonus we're
now more consistent across test suites, as well.

This unskips and thus resolves the following issues:

* elastic#201334
* elastic#220822
* elastic#207913
* elastic#199905

Note that there may be more instances of skipped tests that were failing
due to this issue (with e.g. data with an earlier date than the
`2019-09-02` here); the above tests were just the most obvious and most
recent (within the last week).

### Flaky Runner
* Detection Engine Cypress (x150):
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8291

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit 1f6777c)

# Conflicts:
#	x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts
@rylnd rylnd requested a review from kibanamachine as a code owner May 23, 2025 21:03
@rylnd rylnd added the backport This PR is a backport of another PR label May 23, 2025
@rylnd rylnd enabled auto-merge (squash) May 23, 2025 21:03
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

@rylnd rylnd requested review from a team and denar50 May 30, 2025 15:44
@rylnd rylnd merged commit 4ce9ad0 into elastic:8.19 May 30, 2025
8 checks passed
@rylnd rylnd deleted the backport/8.19/pr-220923 branch May 30, 2025 19:07
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.

3 participants