fixed Docker configuration

This commit is contained in:
Hauke Klement
2015-02-15 11:10:18 +01:00
parent 99d1aaa625
commit 2fab3907c0
2 changed files with 10 additions and 4 deletions

View File

@ -2,8 +2,6 @@ default: &default
connection_timeout: 3
pool:
active: false
interval: 15
maximum_refill_count: 32
ports: !ruby/range 4500..4600
development:
@ -15,6 +13,8 @@ production:
<<: *default
pool:
active: true
interval: 30
maximum_refill_count: 30
workspace_root: <%= Rails.root.join('tmp', 'files', Rails.env) %>
test:

View File

@ -82,6 +82,14 @@ describe DockerContainerPool do
end
describe '.refill' do
let(:config) { double }
let(:maximum_refill_count) { 5 }
before(:each) do
expect(DockerContainerPool).to receive(:config).and_return(config)
expect(config).to receive(:[]).with(:maximum_refill_count).and_return(maximum_refill_count)
end
after(:each) { DockerContainerPool.refill }
it 'regards all execution environments' do
@ -91,11 +99,9 @@ describe DockerContainerPool do
end
context 'with something to refill' do
let(:maximum_refill_count) { 5 }
before(:each) { @execution_environment.update(pool_size: 10) }
it 'complies with the maximum batch size' do
expect(DockerContainerPool::config).to receive(:[]).with(:maximum_refill_count).and_return(maximum_refill_count)
expect_any_instance_of(Concurrent::Future).to receive(:execute) do |future|
expect(DockerContainerPool).to receive(:create_container).with(@execution_environment).exactly(maximum_refill_count).times
future.instance_variable_get(:@task).call