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

[Security Solution] Fixes flaky test rules #81040

Merged
merged 6 commits into from
Oct 21, 2020

Conversation

MadameSheema
Copy link
Member

@MadameSheema MadameSheema commented Oct 19, 2020

Summary

We saw some rule test failing due to a not proper clean up after the execution. This is because right now our Cypress tests are executed 2 more times if there is a failure. If the failure it is due to an assertion or timeout after the rule creation, the next execution is going to fail due to a mismatch in the number of created rules.

In order to fix that flakiness now we are deleting the created rules at the after hook.

@MadameSheema
Copy link
Member Author

@elasticmachine merge upstream

@MadameSheema MadameSheema requested a review from rylnd October 20, 2020 12:13
@MadameSheema MadameSheema self-assigned this Oct 20, 2020
@MadameSheema MadameSheema added release_note:skip Skip the PR/issue when compiling release notes Team:Detections and Resp Security Detection Response Team Team:SIEM v7.10 v7.11.0 v8.0.0 labels Oct 20, 2020
@MadameSheema MadameSheema marked this pull request as ready for review October 20, 2020 12:14
@MadameSheema MadameSheema requested review from a team as code owners October 20, 2020 12:14
@elasticmachine
Copy link
Contributor

Pinging @elastic/siem (Team:SIEM)

@jen-huang jen-huang added v7.10.0 and removed v7.10 labels Oct 20, 2020
Copy link
Contributor

@rylnd rylnd left a comment

Choose a reason for hiding this comment

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

I had one question about ordering and you've got some merge conflicts (from me, sorry 😄 ), but CI should take care of those so you get a pre-emptive approval! Thanks for this fix.

@@ -120,6 +121,7 @@ describe('Custom detection rules creation', () => {

after(() => {
esArchiverUnload('timeline');
deleteRule();
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these two operations totally independent? I assume so but wanted to call out the discrepancy in ordering.

Copy link
Member Author

@MadameSheema MadameSheema Oct 21, 2020

Choose a reason for hiding this comment

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

In this specific case, does not matter the order, but you are right, in general, it should not be like that, good catch! I need to update this 😊

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@MadameSheema MadameSheema merged commit fce3031 into elastic:master Oct 21, 2020
@MadameSheema MadameSheema deleted the flaky/rules branch October 21, 2020 10:30
MadameSheema added a commit to MadameSheema/kibana that referenced this pull request Oct 21, 2020
* deletes the created rule in the after hook

* fixes failing test

* changes rule deletion order

Co-authored-by: Kibana Machine <[email protected]>
MadameSheema added a commit to MadameSheema/kibana that referenced this pull request Oct 21, 2020
* deletes the created rule in the after hook

* fixes failing test

* changes rule deletion order

Co-authored-by: Kibana Machine <[email protected]>
MadameSheema added a commit that referenced this pull request Oct 21, 2020
* deletes the created rule in the after hook

* fixes failing test

* changes rule deletion order

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
MadameSheema added a commit that referenced this pull request Oct 21, 2020
* deletes the created rule in the after hook

* fixes failing test

* changes rule deletion order

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
jloleysens added a commit to jloleysens/kibana that referenced this pull request Oct 21, 2020
…arm-phase-to-formlib

* 'master' of github.com:elastic/kibana: (55 commits)
  [UX] Fix map color variance and apply proper filter for extended stats (elastic#81106)
  [User Experience] Use EuiSelect for percentiles instead of SuperSelect (elastic#81082)
  [DOCS] Add link for monitoring ssl settings (elastic#81057)
  [test] Await loading indicator in monitoring test (elastic#81279)
  [ILM] Minor copy and link additions to cloud CTA for cold phase (elastic#80512)
  [Mappings editor] Add scaled_float and date_range comp integration tests (elastic#81287)
  [Discover] Deangularize context.app (elastic#80851)
  [O11y Overview] Add code to display/hide UX section when appropriate (elastic#80873)
  [Discover] Extend DiscoverNoResults component to show different message on error (elastic#79671)
  Fix tagcloud word overlapping (elastic#81161)
  [Security Solution] Fixes flaky test rules (elastic#81040)
  Changed the code to avoid tech debt with hacky solutions after receiving comments on EUI issue reported about this problem. (elastic#81183)
  [Security Solution][All] Replace old markdown renderer with the new one (elastic#80301)
  Add namespaced version of the API call (elastic#81278)
  [ML] Data Frame Analytics: Fix race condition and support for feature influence legacy format. (elastic#81123)
  [Fleet] Fix POLICY_CHANGE action creation for new policy (elastic#81236)
  [Security Solution][Endpoint][Admin] Malware user notification checkbox (elastic#78084)
  [SecuritySolution][Unit Tests] - fix flakey unit test (elastic#81239)
  skip flaky suite (elastic#81264)
  [Maps] fix top-level Map page is called 'Kibana' (elastic#81238)
  ...

# Conflicts:
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared/forcemerge_field.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/warm_phase.tsx
@MindyRS MindyRS added the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:SIEM v7.10.0 v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants