mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
Merge pull request #353 from mattkirby/vmpooler_flush
(POOLER-153) Add endpoint for resetting a pool
This commit is contained in:
commit
82dae7d04c
6 changed files with 242 additions and 6 deletions
|
|
@ -2876,6 +2876,28 @@ EOT
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'with the pool_reset wakeup option' do
|
||||
let(:wakeup_option) {{
|
||||
:pool_reset => true,
|
||||
:poolname => pool
|
||||
}}
|
||||
|
||||
let(:wakeup_period) { -1 } # A negative number forces the wakeup evaluation to always occur
|
||||
|
||||
context 'when a pool reset is requested' do
|
||||
before(:each) do
|
||||
redis.sadd('vmpooler__poolreset', pool)
|
||||
end
|
||||
|
||||
it 'should sleep until the reset request is detected' do
|
||||
expect(subject).to receive(:sleep).exactly(3).times
|
||||
expect(redis).to receive(:sismember).with('vmpooler__poolreset', pool).and_return(false,false,true)
|
||||
|
||||
subject.sleep_with_wakeup_events(loop_delay, wakeup_period, wakeup_option)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "#check_pool" do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue