Commit 23edce53 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Fix pipeline serializer queries count specs

Conflicts:
	spec/serializers/pipeline_serializer_spec.rb
parent 4e22384d
......@@ -112,7 +112,7 @@ describe PipelineSerializer do
# 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|
Ci::Pipeline::COMPLETED_STATUSES.each do |status|
create_pipeline(status)
end
end
......@@ -125,7 +125,7 @@ describe PipelineSerializer do
it 'verifies number of queries', :request_store do
recorded = ActiveRecord::QueryRecorder.new { subject }
expect(recorded.count).to be_within(1).of(36)
expect(recorded.count).to be_within(2).of(30)
expect(recorded.cached_count).to eq(0)
end
end
......@@ -144,7 +144,8 @@ describe PipelineSerializer do
# pipeline. With the same ref this check is cached but if refs are
# different then there is an extra query per ref
# https://gitlab.com/gitlab-org/gitlab-ce/issues/46368
expect(recorded.count).to be_within(1).of(43)
#
expect(recorded.count).to be_within(2).of(40)
expect(recorded.cached_count).to eq(0)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment