Improve spec performance in `issues_spec.rb`
What does this MR do?
Working towards https://gitlab.com/gitlab-org/plan/-/issues/145
Queries saved: 9688 Time saved: 26 seconds
Before: Total events: 23303
[TEST PROF INFO] Factories usage
Total: 871
Total top-level: 634
Total time: 46.3691s
Total uniq factories: 15
total top-level total time time per call top-level time name
418 418 26.5178s 0.0634s 26.5178s issue
207 57 7.6537s 0.0370s 1.9456s namespace
150 66 23.2245s 0.1548s 9.9039s project
39 39 1.2739s 0.0327s 1.2739s user
14 14 3.5627s 0.2545s 3.5627s merge_request
12 9 1.6138s 0.1345s 1.5888s design
9 9 0.0551s 0.0061s 0.0551s issue_link
5 5 0.5588s 0.1118s 0.5588s labeled_issue
5 5 0.1111s 0.0222s 0.1111s note_on_issue
5 5 0.5231s 0.1046s 0.5231s label
3 3 0.1065s 0.0355s 0.1065s design_version
1 1 0.1591s 0.1591s 0.1591s alert_management_alert
1 1 0.0170s 0.0170s 0.0170s license
1 1 0.0222s 0.0222s 0.0222s incident
1 1 0.0236s 0.0236s 0.0236s quality_test_case
After: Total events: 13615
TEST PROF INFO] Factories usage
Total: 549
Total top-level: 495
Total time: 20.8610s
Total uniq factories: 14
total top-level total time time per call top-level time name
374 374 12.3554s 0.0330s 12.3554s issue
96 57 3.6330s 0.0378s 2.2243s namespace
39 27 5.6434s 0.1447s 4.1049s project
12 9 0.9033s 0.0753s 0.8815s design
5 5 0.4544s 0.0909s 0.4544s label
5 5 0.2835s 0.0567s 0.2835s labeled_issue
5 5 0.1181s 0.0236s 0.1181s note_on_issue
3 3 0.1486s 0.0495s 0.1486s user
3 3 0.1929s 0.0643s 0.1929s design_version
3 3 0.0206s 0.0069s 0.0206s issue_link
1 1 0.0195s 0.0195s 0.0195s alert_management_alert
1 1 0.0148s 0.0148s 0.0148s license
1 1 0.0210s 0.0210s 0.0210s incident
1 1 0.0217s 0.0217s 0.0217s quality_test_case
Screenshots
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Peter Leitzen