Skip to content

Commit

Permalink
Update worker_ttl documentation and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wbclark committed Sep 29, 2021
1 parent 3eebc60 commit 9c7c41e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
3 changes: 2 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
# be done incrementally with benchmarking at each step to determine an optimal value for your deployment.
#
# @param worker_ttl
# The number of seconds before a pulpcore worker should be considered lost.
# The number of seconds before a pulpcore worker should be considered lost. If undefined, pulpcore will use its default setting which is 30 seconds as of
# pulpcore version 3.14. You should not need to modify this setting unless the application reports workers timing out while they are busy completing tasks.
#
# @param use_rq_tasking_system
# Use the older RQ workers tasking system instead of the newer PostgreSQL tasking system introduced in Pulpcore 3.14.
Expand Down
20 changes: 13 additions & 7 deletions spec/acceptance/basic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,20 @@ class { 'pulpcore':
its(:exit_status) { is_expected.to eq 0 }
end

describe command("PULP_SETTINGS=/etc/pulp/settings.py pulpcore-manager diffsettings") do
its(:stdout) { is_expected.to match(/^USE_NEW_WORKER_TYPE = True/) }
its(:exit_status) { is_expected.to eq 0 }
end
describe "Pulpcore Settings" do
let(:settings) { command("PULP_SETTINGS=/etc/pulp/settings.py pulpcore-manager diffsettings") }

describe command("PULP_SETTINGS=/etc/pulp/settings.py pulpcore-manager diffsettings") do
its(:stdout) { is_expected.to match(/^WORKER_TTL = 30/) }
its(:exit_status) { is_expected.to eq 0 }
it "retrieves pulpcore settings" do
expect(settings.exit_status).to eq 0
end

it "uses new worker type" do
expect(settings.stdout).to match(%r{^USE_NEW_WORKER_TYPE = True})
end

it "has default WORKER_TTL of 30 seconds" do
expect(settings.stdout).to match(%r{^WORKER_TTL = 30})
end
end

describe command("DJANGO_SETTINGS_MODULE=pulpcore.app.settings PULP_SETTINGS=/etc/pulp/settings.py rq info -c pulpcore.rqconfig") do
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/pulpcore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -514,14 +514,14 @@
end
end

context 'can change the worker_ttl to 60' do
context "with worker_ttl = 60" do
let :params do
{
worker_ttl: 60
}
end

it do
it "configures pulpcore with WORKER_TTL = 60" do
is_expected.to contain_concat__fragment('base')
.with_content(%r{\sWORKER_TTL = 60})
end
Expand Down

0 comments on commit 9c7c41e

Please sign in to comment.