diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /spec/lib/gitlab/utils/usage_data_spec.rb | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'spec/lib/gitlab/utils/usage_data_spec.rb')
-rw-r--r-- | spec/lib/gitlab/utils/usage_data_spec.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/lib/gitlab/utils/usage_data_spec.rb b/spec/lib/gitlab/utils/usage_data_spec.rb index 13d046b0816..2925ceef256 100644 --- a/spec/lib/gitlab/utils/usage_data_spec.rb +++ b/spec/lib/gitlab/utils/usage_data_spec.rb @@ -31,9 +31,9 @@ RSpec.describe Gitlab::Utils::UsageData do end end - describe '.with_duration' do + describe '.with_metadata' do it 'yields passed block' do - expect { |block| described_class.with_duration(&block) }.to yield_with_no_args + expect { |block| described_class.with_metadata(&block) }.to yield_with_no_args end end @@ -55,7 +55,7 @@ RSpec.describe Gitlab::Utils::UsageData do end it 'records duration' do - expect(described_class).to receive(:with_duration) + expect(described_class).to receive(:with_metadata) allow(relation).to receive(:count).and_return(1) described_class.count(relation, batch: false) @@ -82,7 +82,7 @@ RSpec.describe Gitlab::Utils::UsageData do end it 'records duration' do - expect(described_class).to receive(:with_duration) + expect(described_class).to receive(:with_metadata) allow(relation).to receive(:distinct_count_by).and_return(1) described_class.distinct_count(relation, batch: false) @@ -242,7 +242,7 @@ RSpec.describe Gitlab::Utils::UsageData do end it 'records duration' do - expect(described_class).to receive(:with_duration) + expect(described_class).to receive(:with_metadata) allow(Gitlab::Database::BatchCount).to receive(:batch_sum).and_return(1) described_class.sum(relation, :column) @@ -272,7 +272,7 @@ RSpec.describe Gitlab::Utils::UsageData do end it 'records duration' do - expect(described_class).to receive(:with_duration) + expect(described_class).to receive(:with_metadata) allow(Gitlab::Database::BatchCount).to receive(:batch_average).and_return(1) @@ -367,14 +367,14 @@ RSpec.describe Gitlab::Utils::UsageData do end it 'records duration' do - expect(described_class).to receive(:with_duration) + expect(described_class).to receive(:with_metadata) described_class.histogram(relation, column, buckets: 1..100) end context 'when query timeout' do subject do - with_statement_timeout(0.001) do + with_statement_timeout(0.001, connection: ApplicationRecord.connection) do relation = AlertManagement::HttpIntegration.select('pg_sleep(0.002)') described_class.histogram(relation, column, buckets: 1..100) end @@ -425,7 +425,7 @@ RSpec.describe Gitlab::Utils::UsageData do end it 'records duration' do - expect(described_class).to receive(:with_duration) + expect(described_class).to receive(:with_metadata) described_class.add end @@ -455,7 +455,7 @@ RSpec.describe Gitlab::Utils::UsageData do end it 'records duration' do - expect(described_class).to receive(:with_duration) + expect(described_class).to receive(:with_metadata) described_class.alt_usage_data end @@ -471,7 +471,7 @@ RSpec.describe Gitlab::Utils::UsageData do describe '#redis_usage_data' do it 'records duration' do - expect(described_class).to receive(:with_duration) + expect(described_class).to receive(:with_metadata) described_class.redis_usage_data end @@ -520,7 +520,7 @@ RSpec.describe Gitlab::Utils::UsageData do describe '#with_prometheus_client' do it 'records duration' do - expect(described_class).to receive(:with_duration) + expect(described_class).to receive(:with_metadata) described_class.with_prometheus_client { |client| client } end |