puppet-congress/spec/classes/congress_db_sync_spec.rb
ZhongShengping d6ff0c15c4 Added retries for db_sync
If db sync fails, it is never retried leading to errors. So, this
patch adds retries for db_sync to avoid sync fails.

Change-Id: Ieb5f39dbc53bb7a1a2031eb139bb3d8cda579cb4
Closes-Bug: #1628580
2016-12-06 14:34:10 +08:00

41 lines
1.1 KiB
Ruby

require 'spec_helper'
describe 'congress::db::sync' do
shared_examples_for 'congress-dbsync' do
it 'runs congress-db-sync' do
is_expected.to contain_exec('congress-db-sync').with(
:command => 'congress-db-manage --config-file /etc/congress/congress.conf upgrade head',
:path => ["/bin", "/usr/bin"],
:refreshonly => true,
:user => 'congress',
:try_sleep => 5,
:tries => 10,
:logoutput => 'on_failure',
:subscribe => ['Anchor[congress::install::end]',
'Anchor[congress::config::end]',
'Anchor[congress::dbsync::begin]'],
:notify => 'Anchor[congress::dbsync::end]',
)
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge(OSDefaults.get_facts({
:os_workers => 8,
:concat_basedir => '/var/lib/puppet/concat'
}))
end
it_configures 'congress-dbsync'
end
end
end