diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2017-09-19 10:55:37 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-09-19 10:55:37 +0000 |
commit | 64d7ec0a9e3ffd6233ccfbe9100f8a9391c648e5 (patch) | |
tree | 2cc89bc2d1087eb145918c6ae8cbf70878d40e97 /spec/serializers | |
parent | 39dd7736585d3e35d5c6f391e6a94c312da09056 (diff) | |
download | gitlab-ce-64d7ec0a9e3ffd6233ccfbe9100f8a9391c648e5.tar.gz |
Detect n+1 issues involving Gitaly
Diffstat (limited to 'spec/serializers')
-rw-r--r-- | spec/serializers/pipeline_serializer_spec.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/serializers/pipeline_serializer_spec.rb b/spec/serializers/pipeline_serializer_spec.rb index 2de8daba6b5..3baf9b1edab 100644 --- a/spec/serializers/pipeline_serializer_spec.rb +++ b/spec/serializers/pipeline_serializer_spec.rb @@ -103,9 +103,15 @@ describe PipelineSerializer do let(:project) { create(:project) } before do - Ci::Pipeline::AVAILABLE_STATUSES.each do |status| - create_pipeline(status) + # Since RequestStore.active? is true we have to allow the + # gitaly calls in this block + # Issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/37772 + Gitlab::GitalyClient.allow_n_plus_1_calls do + Ci::Pipeline::AVAILABLE_STATUSES.each do |status| + create_pipeline(status) + end end + Gitlab::GitalyClient.reset_counts end shared_examples 'no N+1 queries' do |