As Openstack projects continue to have longer database migration chains, the Puppet default timeout of 300 seconds for an execution is becoming too short a duration on some hardware, leading to timeouts. As projects continue to add more migration scripts without "pruning" the base, timeouts will continue to become more frequent unless this time can be expanded. The proposed change adds a configuration option db_sync_timeout which maintains the Puppet default of 300 but allows TripleO to change the timeout to something higher. Change-Id: I6b30a4d9e3ca25d9a473e4eb614a8769fa4567e7
81 lines
2.3 KiB
Ruby
81 lines
2.3 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'nova::db::sync_api' do
|
|
|
|
shared_examples_for 'nova-dbsync-api' do
|
|
context 'with defaults' do
|
|
it {
|
|
is_expected.to contain_exec('nova-db-sync-api').with(
|
|
:command => '/usr/bin/nova-manage api_db sync',
|
|
:refreshonly => 'true',
|
|
:timeout => 300,
|
|
:logoutput => 'on_failure',
|
|
:subscribe => ['Anchor[nova::install::end]',
|
|
'Anchor[nova::config::end]',
|
|
'Anchor[nova::dbsync_api::begin]'],
|
|
:notify => 'Anchor[nova::dbsync_api::end]',
|
|
)
|
|
}
|
|
it { is_expected.to contain_class('nova::db::sync_cell_v2') }
|
|
end
|
|
|
|
context "overriding extra_params" do
|
|
let :params do
|
|
{
|
|
:extra_params => '--config-file /etc/nova/nova.conf',
|
|
:cellv2_setup => false
|
|
}
|
|
end
|
|
|
|
it {
|
|
is_expected.to contain_exec('nova-db-sync-api').with(
|
|
:command => '/usr/bin/nova-manage --config-file /etc/nova/nova.conf api_db sync',
|
|
:refreshonly => 'true',
|
|
:timeout => 300,
|
|
:logoutput => 'on_failure',
|
|
:subscribe => ['Anchor[nova::install::end]',
|
|
'Anchor[nova::config::end]',
|
|
'Anchor[nova::dbsync_api::begin]'],
|
|
:notify => 'Anchor[nova::dbsync_api::end]',
|
|
)
|
|
}
|
|
it { is_expected.to_not contain_class('nova::db::sync_cell_v2') }
|
|
end
|
|
|
|
context "overriding db_sync_timeout" do
|
|
let :params do
|
|
{
|
|
:db_sync_timeout => 750
|
|
}
|
|
end
|
|
|
|
it {
|
|
is_expected.to contain_exec('nova-db-sync-api').with(
|
|
:command => '/usr/bin/nova-manage api_db sync',
|
|
:refreshonly => 'true',
|
|
:timeout => 750,
|
|
:logoutput => 'on_failure',
|
|
:subscribe => ['Anchor[nova::install::end]',
|
|
'Anchor[nova::config::end]',
|
|
'Anchor[nova::dbsync_api::begin]'],
|
|
:notify => 'Anchor[nova::dbsync_api::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())
|
|
end
|
|
|
|
it_configures 'nova-dbsync-api'
|
|
end
|
|
end
|
|
|
|
end
|