Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/redis/cache_spec.rb')
-rw-r--r--spec/lib/gitlab/redis/cache_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/lib/gitlab/redis/cache_spec.rb b/spec/lib/gitlab/redis/cache_spec.rb
index 82ff8a26199..64615c4d9ad 100644
--- a/spec/lib/gitlab/redis/cache_spec.rb
+++ b/spec/lib/gitlab/redis/cache_spec.rb
@@ -26,5 +26,22 @@ RSpec.describe Gitlab::Redis::Cache do
expect(described_class.active_support_config[:expires_in]).to eq(1.day)
end
+
+ context 'when encountering an error' do
+ let(:cache) { ActiveSupport::Cache::RedisCacheStore.new(**described_class.active_support_config) }
+
+ subject { cache.read('x') }
+
+ before do
+ described_class.with do |redis|
+ allow(redis).to receive(:get).and_raise(::Redis::CommandError)
+ end
+ end
+
+ it 'logs error' do
+ expect(::Gitlab::ErrorTracking).to receive(:log_exception)
+ subject
+ end
+ end
end
end