diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
commit | 0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch) | |
tree | 7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /spec/services/notification_recipients/build_service_spec.rb | |
parent | 72123183a20411a36d607d70b12d57c484394c8e (diff) |
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'spec/services/notification_recipients/build_service_spec.rb')
-rw-r--r-- | spec/services/notification_recipients/build_service_spec.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/services/notification_recipients/build_service_spec.rb b/spec/services/notification_recipients/build_service_spec.rb index ff54d6ccd2f..899d23ec641 100644 --- a/spec/services/notification_recipients/build_service_spec.rb +++ b/spec/services/notification_recipients/build_service_spec.rb @@ -14,6 +14,9 @@ RSpec.describe NotificationRecipients::BuildService do shared_examples 'no N+1 queries' do it 'avoids N+1 queries', :request_store do + # existing N+1 due to multiple users having to be looked up in the project_authorizations table + threshold = project.private? ? 1 : 0 + create_user service.build_new_note_recipients(note) @@ -24,7 +27,7 @@ RSpec.describe NotificationRecipients::BuildService do create_user - expect { service.build_new_note_recipients(note) }.not_to exceed_query_limit(control_count) + expect { service.build_new_note_recipients(note) }.not_to exceed_query_limit(control_count).with_threshold(threshold) end end @@ -66,6 +69,9 @@ RSpec.describe NotificationRecipients::BuildService do shared_examples 'no N+1 queries' do it 'avoids N+1 queries', :request_store do + # existing N+1 due to multiple users having to be looked up in the project_authorizations table + threshold = project.private? ? 1 : 0 + create_user service.build_new_review_recipients(review) @@ -76,7 +82,7 @@ RSpec.describe NotificationRecipients::BuildService do create_user - expect { service.build_new_review_recipients(review) }.not_to exceed_query_limit(control_count) + expect { service.build_new_review_recipients(review) }.not_to exceed_query_limit(control_count).with_threshold(threshold) end end |