Speed up rake task executor service spec
What does this MR do and why?
This MR speeds up describe '#create_empty_index'
in ee/spec/services/search/rake_task_executor_service_spec.rb:33
from 25m:15s
to 1m:57s
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Before
❯ bin/rspec ee/spec/services/search/rake_task_executor_service_spec.rb:33
Running via Spring preloader in process 28595
Run options: include {:focus=>true, :locations=>{"./ee/spec/services/search/rake_task_executor_service_spec.rb"=>[33]}}
Test environment set up in 2.68229 seconds
.......................
Finished in 25 minutes 15 seconds (files took 4.01 seconds to load)
23 examples, 0 failures
Randomized with seed 39722
[TEST PROF INFO] Time spent in factories: 00:00.011 (0.0% of total time)
After
❯ bin/rspec ee/spec/services/search/rake_task_executor_service_spec.rb:33
Running via Spring preloader in process 39496
Run options: include {:focus=>true, :locations=>{"./ee/spec/services/search/rake_task_executor_service_spec.rb"=>[33]}}
Test environment set up in 2.197134 seconds
.......
Finished in 1 minute 56.85 seconds (files took 3.91 seconds to load)
7 examples, 0 failures
Randomized with seed 49140
[TEST PROF INFO] Time spent in factories: 00:00.027 (0.02% of total time)
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
Edited by Dmitry Gruzd