Speed up elastic backfill specs
What does this MR do and why?
This MR changes traits for some Elasticsearch specs from :elastic_clean, which recreates all indices for every example, to :elastic_delete_by_query, which does that only for every context.
This reduces the execution time for these specs from 2.5 minutes to roughly 1 minute.
Screenshots or screen recordings
Before
$ bin/rspec ee/spec/elastic/migrate/20220825102900_backfill_label_ids_for_issues_spec.rb ee/spec/elastic/migrate/20230131184300_backfill_traversal_ids_for_projects_spec.rb ee/spec/elastic/migrate/20230203122938_backfill_internal_on_notes_spec.rb
...
Finished in 2 minutes 27 seconds (files took 1.26 seconds to load)
After
$ bin/rspec ee/spec/elastic/migrate/20220825102900_backfill_label_ids_for_issues_spec.rb ee/spec/elastic/migrate/20230131184300_backfill_traversal_ids_for_projects_spec.rb ee/spec/elastic/migrate/20230203122938_backfill_internal_on_notes_spec.rb
...
Finished in 1 minute 12.81 seconds (files took 1.39 seconds to load)
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Dmitry Gruzd