diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 13:49:51 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 13:49:51 +0000 |
commit | 71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch) | |
tree | 6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /spec/tasks/cache | |
parent | a7253423e3403b8c08f8a161e5937e1488f5f407 (diff) | |
download | gitlab-ce-15.9.0-rc42.tar.gz |
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'spec/tasks/cache')
-rw-r--r-- | spec/tasks/cache/clear/redis_spec.rb | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/spec/tasks/cache/clear/redis_spec.rb b/spec/tasks/cache/clear/redis_spec.rb index 9b6ea3891d9..375d01bf2ba 100644 --- a/spec/tasks/cache/clear/redis_spec.rb +++ b/spec/tasks/cache/clear/redis_spec.rb @@ -3,7 +3,7 @@ require 'rake_helper' RSpec.describe 'clearing redis cache', :clean_gitlab_redis_repository_cache, :clean_gitlab_redis_cache, - :silence_stdout, feature_category: :redis do + :silence_stdout, :use_null_store_as_repository_cache, feature_category: :redis do before do Rake.application.rake_require 'tasks/cache' end @@ -20,37 +20,11 @@ RSpec.describe 'clearing redis cache', :clean_gitlab_redis_repository_cache, :cl create(:ci_pipeline, project: project).project.pipeline_status end - context 'when use_primary_and_secondary_stores_for_repository_cache MultiStore FF is enabled' do - # Initially, project:{id}:pipeline_status is explicitly cached in Gitlab::Redis::Cache, whereas repository is - # cached in Rails.cache (which is a NullStore). - # With the MultiStore feature flag enabled, we use Gitlab::Redis::RepositoryCache instance as primary store and - # Gitlab::Redis::Cache as secondary store. - # This ends up storing 2 extra keys (exists? and root_ref) in both Gitlab::Redis::RepositoryCache and - # Gitlab::Redis::Cache instances when loading project.pipeline_status - let(:keys_size_changed) { -3 } - - before do - stub_feature_flags(use_primary_and_secondary_stores_for_repository_cache: true) - allow(pipeline_status).to receive(:loaded).and_return(nil) - end - - it 'clears pipeline status cache' do - expect { run_rake_task('cache:clear:redis') }.to change { pipeline_status.has_cache? } - end - - it_behaves_like 'clears the cache' + before do + allow(pipeline_status).to receive(:loaded).and_return(nil) end - context 'when use_primary_and_secondary_stores_for_repository_cache and - use_primary_store_as_default_for_repository_cache feature flags are disabled' do - before do - stub_feature_flags(use_primary_and_secondary_stores_for_repository_cache: false) - stub_feature_flags(use_primary_store_as_default_for_repository_cache: false) - allow(pipeline_status).to receive(:loaded).and_return(nil) - end - - it_behaves_like 'clears the cache' - end + it_behaves_like 'clears the cache' end describe 'clearing set caches' do |