-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should backend_cache default to true? #212
Comments
bump? |
PR #264 made enabling the backend cache the default, but there is an argument for exposing the option while leasing it disabled by default - it is less surprising behavior. #264 (comment) |
We just got around to updating the gems across ~100 repos in our organisation. During that process, we found that a couple of our repos had tests that were failing. Immediately noticed that the actual tests that were failing involved some form of retries. describe 'Initialization' do
it 'should be completed', retry: 60, retry_wait: 1 do
expect(file(logfile).content).to include 'Initialization Sequence Completed'
end
end
describe port(pn) do
# It takes a while to the port to be listening, so we add a little sleep
before do
30.times do
unless port(pn).listening?
puts "Port #{pn} isn't ready, retrying.."
sleep 1
end
end
end
it { should be_listening }
its('protocols') { should include 'tcp' }
its('addresses') { should include '127.0.0.1' }
end
Tracked the issue down to #264 -- realised that the backend cache prevents new changes from being seen, obviously. Fixed both repos by disabling verifier:
name: inspec
...
# This formula has InSpec controls which involve retrying tests, to allow time,
# for example, for services to start up fully. These retries will not pick
# up these changes if the backend cache is in use, so it's set to `false` here.
backend_cache: false Keeping the benefit of |
As of Inspec v2.1.0 the cli option --backend-cache defaults to enabled, yet it appears that in kitchen-inspec the default for backend_cache is disabled. Shouldn't it default to enabled?
Tested with:
Running 180 inspec tests against a windows 2016 instance took 6 minutes without backend_cache specified but only 35 seconds with backend_cache: true
The text was updated successfully, but these errors were encountered: