diff --git a/spec/chef/redis/redis_spec.rb b/spec/chef/redis/redis_spec.rb index b18378b3e0fd3e005369ec4016ca362e219c0ab4_c3BlYy9jaGVmL3JlZGlzL3JlZGlzX3NwZWMucmI=..d49d3fc36f8d612f16a5a6eef8a1dd7da7bf32a3_c3BlYy9jaGVmL3JlZGlzL3JlZGlzX3NwZWMucmI= 100644 --- a/spec/chef/redis/redis_spec.rb +++ b/spec/chef/redis/redis_spec.rb @@ -23,6 +23,8 @@ expect(content).to match(/^maxmemory-samples 5/) expect(content).to match(/^tcp-backlog 511/) expect(content).to match(/^rename-command KEYS ""$/) + expect(content).to match(/^lazyfree-lazy-eviction no$/) + expect(content).to match(/^lazyfree-lazy-expire no$/) expect(content).not_to match(/^slaveof/) } end @@ -215,6 +217,24 @@ end end + context 'with lazy eviction enabled' do + before do + stub_gitlab_rb( + redis: { + lazyfree_lazy_eviction: true + } + ) + end + + it 'creates redis config with lazyfree-lazy-eviction yes' do + expect(chef_run).to render_file('/var/opt/gitlab/redis/redis.conf') + .with_content { |content| + expect(content).to match(/^lazyfree-lazy-eviction yes$/) + expect(content).to match(/^lazyfree-lazy-expire no$/) + } + end + end + context 'with redis disabled' do before do stub_gitlab_rb(redis: { enable: false })