summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/application/puppetqd.rb6
-rwxr-xr-xspec/unit/application/puppetqd.rb5
2 files changed, 4 insertions, 7 deletions
diff --git a/lib/puppet/application/puppetqd.rb b/lib/puppet/application/puppetqd.rb
index 05bb21fe9..a3a302e17 100644
--- a/lib/puppet/application/puppetqd.rb
+++ b/lib/puppet/application/puppetqd.rb
@@ -39,7 +39,7 @@ Puppet::Application.new(:puppetqd) do
catalog.save
end
- sleep_forever()
+ Thread.list.each { |thread| thread.join }
end
# Handle the logging settings.
@@ -69,8 +69,4 @@ Puppet::Application.new(:puppetqd) do
daemon.daemonize if Puppet[:daemonize]
end
-
- def sleep_forever
- while true do sleep 1000 end
- end
end
diff --git a/spec/unit/application/puppetqd.rb b/spec/unit/application/puppetqd.rb
index 198043efc..0b949385a 100755
--- a/spec/unit/application/puppetqd.rb
+++ b/spec/unit/application/puppetqd.rb
@@ -161,6 +161,7 @@ describe "puppetqd" do
before :each do
@puppetqd.stubs(:sleep_forever)
Puppet::Resource::Catalog::Queue.stubs(:subscribe)
+ Thread.list.each { |t| t.stubs(:join) }
end
it "should subscribe to the queue" do
@@ -177,8 +178,8 @@ describe "puppetqd" do
@puppetqd.main
end
- it "should loop and sleep forever" do
- @puppetqd.expects(:sleep_forever)
+ it "should join all of the running threads" do
+ Thread.list.each { |t| t.expects(:join) }
@puppetqd.main
end
end