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 Solutions][Detection Engine] Changes the loading of indexes in tests from beforeEach() to before() #110340

Merged
merged 1 commit into from
Aug 26, 2021

Conversation

FrankHassanabad
Copy link
Contributor

@FrankHassanabad FrankHassanabad commented Aug 26, 2021

Summary

Changes the loading of indexes in tests from beforeEach() to before()

Hoping this fixes some flake we have seen recently. If it doesn't, at least tests should run faster and be less flake overall. If these two below do begin acting up again I will then probably resort to wrapping the individual tests around retry blocks or removing the tests.

Also found one area within x-pack/test/detection_engine_api_integration/security_and_spaces/tests/generating_signals.ts where we do a load twice but I fixed it to the load/unload pattern.

Issues this should fix:

Checklist

@FrankHassanabad FrankHassanabad requested a review from a team as a code owner August 26, 2021 20:34
@FrankHassanabad FrankHassanabad self-assigned this Aug 26, 2021
@FrankHassanabad FrankHassanabad added v8.0.0 v7.16.0 auto-backport Deprecated - use backport:version if exact versions are needed Team:Detections and Resp Security Detection Response Team labels Aug 26, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@FrankHassanabad FrankHassanabad added the release_note:skip Skip the PR/issue when compiling release notes label Aug 26, 2021
@FrankHassanabad FrankHassanabad requested a review from spong August 26, 2021 20:35
});

afterEach(async () => {
await deleteSignalsIndex(supertest);
await deleteAllAlerts(supertest);
await esArchiver.load('x-pack/test/functional/es_archives/auditbeat/hosts');
Copy link
Contributor Author

@FrankHassanabad FrankHassanabad Aug 26, 2021

Choose a reason for hiding this comment

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

NOTE: This one was a load instead of unload and did not technically ever unload the hosts, so I fixed it here.

Copy link
Member

@spong spong left a comment

Choose a reason for hiding this comment

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

LGTM once green on CI! 👍 Thank-you for the optimization and cleanup here! 🙂

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

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

cc @FrankHassanabad

@FrankHassanabad FrankHassanabad merged commit 35b59cd into elastic:master Aug 26, 2021
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 26, 2021
…elastic#110340)

## Summary

Changes the loading of indexes in tests from beforeEach() to before()

Hoping this fixes some flake we have seen recently. If it doesn't, at least tests should run faster and be less flake overall. If these two below do begin acting up again I will then probably resort to wrapping the individual tests around retry blocks or removing the tests.

Also found one area within `x-pack/test/detection_engine_api_integration/security_and_spaces/tests/generating_signals.ts` where we do a `load` twice but I fixed it to the `load`/`unload` pattern.

Issues this should fix:
* elastic#107911
* elastic#107856

### Checklist

- [ ] [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
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

@FrankHassanabad FrankHassanabad deleted the make-e2e-faster branch August 26, 2021 23:03
kibanamachine added a commit that referenced this pull request Aug 30, 2021
…#110340) (#110368)

## Summary

Changes the loading of indexes in tests from beforeEach() to before()

Hoping this fixes some flake we have seen recently. If it doesn't, at least tests should run faster and be less flake overall. If these two below do begin acting up again I will then probably resort to wrapping the individual tests around retry blocks or removing the tests.

Also found one area within `x-pack/test/detection_engine_api_integration/security_and_spaces/tests/generating_signals.ts` where we do a `load` twice but I fixed it to the `load`/`unload` pattern.

Issues this should fix:
* #107911
* #107856

### Checklist

- [ ] [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

Co-authored-by: Frank Hassanabad <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Detections and Resp Security Detection Response Team v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants