Skip to content

Reduce the duration of legacy_upload_mover_spec.rb from 2m9s to 48s

Rémy Coutable requested to merge improve-legacy_upload_mover_spec.rb into master

What does this MR do?

Before

› time bin/rspec spec/lib/gitlab/background_migration/legacy_upload_mover_spec.rb

Running via Spring preloader in process 429
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}
WARNING: Active Record does not support composite primary key.

project_authorizations has composite primary key. Composite primary key is ignored.
.........................................................

Finished in 2 minutes 9.2 seconds (files took 2.68 seconds to load)
57 examples, 0 failures

bin/rspec spec/lib/gitlab/background_migration/legacy_upload_mover_spec.rb  0.31s user 0.41s system 0% cpu 2:13.47 total

After

› time bin/rspec spec/lib/gitlab/background_migration/legacy_upload_mover_spec.rb

Running via Spring preloader in process 98599
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}
WARNING: Active Record does not support composite primary key.

project_authorizations has composite primary key. Composite primary key is ignored.
.................

Finished in 48.15 seconds (files took 2.62 seconds to load)
17 examples, 0 failures

bin/rspec spec/lib/gitlab/background_migration/legacy_upload_mover_spec.rb  0.31s user 0.35s system 1% cpu 52.580 total

=> 62% faster! 🚀

Related to #237841 (comment 436880878).

Edited by Rémy Coutable

Merge request reports

Loading