Skip to content

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

Merged
rylnd merged 4 commits intoelastic:9.0from
rylnd:backport/9.0/pr-220923
Jun 2, 2025
Merged

[9.0] [Detection Engine] Prevent test data from rolling outside of Cypress rules' query (#220923)#221437
rylnd merged 4 commits intoelastic:9.0from
rylnd:backport/9.0/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 9.0:

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
#	x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/indicator_match_rule.cy.ts
@rylnd rylnd requested a review from kibanamachine as a code owner May 23, 2025 21:00
@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:00
@rylnd
Copy link
Copy Markdown
Contributor Author

rylnd commented May 30, 2025

This backport is failing due to the 9.0 branch lacking #217276. Working on getting that in, first.

 Conflicts:
	x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/indicator_match_rule.cy.ts
@rylnd
Copy link
Copy Markdown
Contributor Author

rylnd commented May 30, 2025

Okay, this should go green now that #221991 is into 9.0 and 9.0 has been merged in here.

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

@rylnd rylnd requested review from a team and dhurley14 June 2, 2025 14:28
@rylnd rylnd self-assigned this Jun 2, 2025
Copy link
Copy Markdown
Contributor

@denar50 denar50 left a comment

Choose a reason for hiding this comment

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

LGTM

@rylnd rylnd merged commit 44a8d2a into elastic:9.0 Jun 2, 2025
9 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] x-pack/test/alerting_api_integration/security_and_spaces/group1/config.ts / alerting api integration security and spaces enabled Alerts - Group 1 alerts rule gaps update gaps should handle task failures
  • [job] [logs] Jest Tests #4 / Category can submit without setting a category

Metrics [docs]

✅ unchanged

History

cc @rylnd

@rylnd rylnd deleted the backport/9.0/pr-220923 branch June 3, 2025 19:48
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.

4 participants