From 7a5955ba5bac14021099c7ee3a62d914b5c7fa4b Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Mon, 15 Oct 2018 10:39:09 +0100 Subject: Verify that usage ping works when all counts time out --- spec/lib/gitlab/usage_data_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/lib/gitlab/usage_data_spec.rb b/spec/lib/gitlab/usage_data_spec.rb index d669c42ab4a..69ee5ff4bcd 100644 --- a/spec/lib/gitlab/usage_data_spec.rb +++ b/spec/lib/gitlab/usage_data_spec.rb @@ -127,6 +127,13 @@ describe Gitlab::UsageData do expect(count_data[:clusters_applications_prometheus]).to eq(1) expect(count_data[:clusters_applications_runner]).to eq(1) end + + it 'works when queries time out' do + allow_any_instance_of(ActiveRecord::Relation) + .to receive(:count).and_raise(ActiveRecord::StatementInvalid.new('')) + + expect { subject }.not_to raise_error + end end describe '#features_usage_data_ce' do -- cgit v1.2.1