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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-12-22 15:16:22 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-12-22 15:16:22 +0300
commit96891fec6dfa20a8342a3daa25935213cfddae22 (patch)
treea09d9a3c565d28b33d0bbc1c1202061c8eb061b9 /spec/lib/gitlab/redis
parent8bf2e2b73e5898c78dd057e02828b6acc1647a70 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/redis')
-rw-r--r--spec/lib/gitlab/redis/multi_store_spec.rb40
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/lib/gitlab/redis/multi_store_spec.rb b/spec/lib/gitlab/redis/multi_store_spec.rb
index 76731bb916c..663040e0ca7 100644
--- a/spec/lib/gitlab/redis/multi_store_spec.rb
+++ b/spec/lib/gitlab/redis/multi_store_spec.rb
@@ -646,6 +646,26 @@ RSpec.describe Gitlab::Redis::MultiStore do
expect(multi_store.use_primary_and_secondary_stores?).to be false
end
end
+
+ context 'with empty DB' do
+ before do
+ allow(Feature::FlipperFeature).to receive(:table_exists?).and_return(false)
+ end
+
+ it 'multi store is disabled' do
+ expect(multi_store.use_primary_and_secondary_stores?).to be false
+ end
+ end
+
+ context 'when FF table guard raises' do
+ before do
+ allow(Feature::FlipperFeature).to receive(:table_exists?).and_raise
+ end
+
+ it 'multi store is disabled' do
+ expect(multi_store.use_primary_and_secondary_stores?).to be false
+ end
+ end
end
describe '#use_primary_store_as_default?' do
@@ -668,6 +688,26 @@ RSpec.describe Gitlab::Redis::MultiStore do
expect(multi_store.use_primary_store_as_default?).to be false
end
end
+
+ context 'with empty DB' do
+ before do
+ allow(Feature::FlipperFeature).to receive(:table_exists?).and_return(false)
+ end
+
+ it 'multi store is disabled' do
+ expect(multi_store.use_primary_and_secondary_stores?).to be false
+ end
+ end
+
+ context 'when FF table guard raises' do
+ before do
+ allow(Feature::FlipperFeature).to receive(:table_exists?).and_raise
+ end
+
+ it 'multi store is disabled' do
+ expect(multi_store.use_primary_and_secondary_stores?).to be false
+ end
+ end
end
def create_redis_store(options, extras = {})