Speed up admin_adds_license_spec.rb
What does this MR do and why?
Speed up one of the slower specs from https://gitlab-org.gitlab.io/rspec_profiling_stats/.
It turns out that has_button?
is quite slow, so we skip calling it. It takes about 50% of time just to check the button exists. This section is
expanded by default in test so no need to perform this expensive action.
Screenshots or screen recordings
Using stackprof (bin/rspec-stackprof --speedscope=true <spec>
) we can see the timings
How to set up and validate locally
- Run
time bundle exec rspec -f d ./ee/spec/features/admin/licenses/admin_adds_license_spec.rb
On this branch it's around 1 minute 20s
. On master
it's around 8 minutes
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 Thong Kuah