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

Run tests in parallel in many detection_engine_api_integration data_types suites #130591

Closed

Conversation

brianseeders
Copy link
Contributor

@brianseeders brianseeders commented Apr 19, 2022

CI Group 24 is currently one of that longest parts of CI, clocking in at about 56 minutes. 50 minutes of that is just the Detection exceptions data types and operators tests. Rather than just breaking them out into multiple new CI Groups, I took a peek at them to see why they were taking so long. I noticed that it appeared that a lot of them could be run in parallel, so I refactored the two longest suites to run many of the test cases in parallel. The two of them together went from 17 minutes to about 3 minutes.

The entire CI Group would probably only be about 10 minutes long if the other suites were refactored in a similar way.

This is what a failure now looks like:

00:01:37 1)    detection engine api security and spaces enabled
00:01:37
00:01:37          Detection exceptions data types and operators
00:01:37
00:01:37              Rule exception operators for data type long
00:01:37                "is" operator:
00:01:37
00:01:37       Error: during should find all the long from the data set when no exceptions are set on the rule:
00:01:37  Error: expected [ 1, 2, 3, 4 ] to sort of equal [ '1', '2', '3', '4', 'TEST_ERROR' ]

Inside x-pack/test/detection_engine_api_integration/security_and_spaces/tests/exception_operators_data_types tests:

  • Modify helpers to use unique IDs/filenames on each invocation
  • Do less cleanup after every single test run
  • Parallelize exception deletion during cleanup
  • Add a new helper for running multiple async test cases in parallel
  • In two suites, for tests that were previously grouped together inside describe() blocks, run them in parallel together

Let me know what you folks think about this approach to these tests.

@brianseeders brianseeders marked this pull request as ready for review April 21, 2022 15:15
@brianseeders brianseeders requested a review from a team as a code owner April 21, 2022 15:15
@brianseeders brianseeders added Team:Operations Team label for Operations Team release_note:skip Skip the PR/issue when compiling release notes Feature:CI Continuous integration Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. auto-backport Deprecated - use backport:version if exact versions are needed v8.3.0 v8.2.1 labels Apr 21, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

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 Feature:CI Continuous integration release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.2.1 v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants