[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.6-1-356-g5718585

James Turnbull james at lovedthanlost.net
Fri Jan 23 14:21:48 UTC 2009


The following commit has been merged in the master branch:
commit 0171e25ec457e9e9d078aabbea491bbcd03448bf
Author: Luke Kanies <luke at madstop.com>
Date:   Fri Nov 28 23:58:04 2008 -0600

    Fixing #1749 - Splay now hopefully behaves "better" for small values.
    
    Signed-off-by: Luke Kanies <luke at madstop.com>

diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb
index 5e9422b..073d2e2 100644
--- a/lib/puppet/network/client/master.rb
+++ b/lib/puppet/network/client/master.rb
@@ -488,7 +488,7 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
         return unless Puppet[:splay]
         return if splayed?
 
-        time = rand(Integer(Puppet[:splaylimit]))
+        time = rand(Integer(Puppet[:splaylimit] + 1))
         Puppet.info "Sleeping for %s seconds (splay is enabled)" % time
         sleep(time)
         @splayed = true
diff --git a/spec/unit/network/client/master.rb b/spec/unit/network/client/master.rb
index f55ba31..0500887 100755
--- a/spec/unit/network/client/master.rb
+++ b/spec/unit/network/client/master.rb
@@ -411,29 +411,29 @@ describe Puppet::Network::Client::Master, " when using the cached catalog" do
                 Puppet.stubs(:[]).with(:splaylimit).returns(42)
             end
 
-            it "should sleep for a random time" do
-                @client.expects(:rand).with(42).returns(42)
-                @client.expects(:sleep).with(42)
+            it "should sleep for a random time plus 1" do
+                @client.expects(:rand).with(43).returns(43)
+                @client.expects(:sleep).with(43)
                 @client.send(:splay)
             end
 
             it "should inform that it is splayed" do
-                @client.stubs(:rand).with(42).returns(42)
-                @client.stubs(:sleep).with(42)
+                @client.stubs(:rand).with(43).returns(43)
+                @client.stubs(:sleep).with(43)
                 Puppet.expects(:info)
                 @client.send(:splay)
             end
 
             it "should set splay = true" do
-                @client.stubs(:rand).with(42).returns(42)
-                @client.stubs(:sleep).with(42)
+                @client.stubs(:rand).returns(43)
+                @client.stubs(:sleep)
                 @client.send(:splay)
                 @client.send(:splayed?).should == true
             end
 
             it "should do nothing if already splayed" do
-                @client.stubs(:rand).with(42).returns(42).at_most_once
-                @client.stubs(:sleep).with(42).at_most_once
+                @client.stubs(:rand).returns(43).at_most_once
+                @client.stubs(:sleep).at_most_once
                 @client.send(:splay)
                 @client.send(:splay)
             end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list