From bc9a0e10b50430e0b253a15d1628b6776d0bd9fe Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Wed, 23 May 2018 14:22:22 +0200 Subject: Reduce amount of expected pipeline serialization queries in specs --- spec/controllers/projects/pipelines_controller_spec.rb | 2 +- spec/serializers/pipeline_serializer_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb index d7253c90ee5..62eece8de4a 100644 --- a/spec/controllers/projects/pipelines_controller_spec.rb +++ b/spec/controllers/projects/pipelines_controller_spec.rb @@ -36,7 +36,7 @@ describe Projects::PipelinesController do expect(json_response['count']['running']).to eq '1' expect(json_response['count']['pending']).to eq '1' expect(json_response['count']['finished']).to eq '2' - expect(queries.count).to be_within(2).of(29) + expect(queries.count).to be < 30 end it 'does not include coverage data for the pipelines' do diff --git a/spec/serializers/pipeline_serializer_spec.rb b/spec/serializers/pipeline_serializer_spec.rb index b741308e2c5..5108eb4deec 100644 --- a/spec/serializers/pipeline_serializer_spec.rb +++ b/spec/serializers/pipeline_serializer_spec.rb @@ -120,7 +120,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(44) + expect(recorded.count).to be_within(1).of(38) expect(recorded.cached_count).to eq(0) end end @@ -139,7 +139,7 @@ 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(51) + expect(recorded.count).to be_within(1).of(45) expect(recorded.cached_count).to eq(0) end end -- cgit v1.2.1