Skip to content

Reduce the duration of migrate_uploads_worker_spec.rb from 2m11s to 21s

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

What does this MR do?

Before

› time bin/rspec spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.rb       

Running via Spring preloader in process 24245
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 11.8 seconds (files took 2.93 seconds to load)
26 examples, 0 failures

bin/rspec spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.r  0.38s user 0.40s system 0% cpu 2:16.76 total

After

› time bin/rspec spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.rb

Running via Spring preloader in process 26122
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 21.6 seconds (files took 2.56 seconds to load)
23 examples, 0 failures

bin/rspec spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.r  0.33s user 0.38s system 2% cpu 26.088 total

=> 84% faster! 🚀

Related to #237841 (comment 436880878).

Edited by Rémy Coutable

Merge request reports

Loading