[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Daniel Pittman daniel at puppetlabs.com
Tue May 10 08:17:49 UTC 2011


The following commit has been merged in the experimental branch:
commit 7591de7e4ef20726a9a174ec8728bec4119d751c
Author: Daniel Pittman <daniel at puppetlabs.com>
Date:   Thu Apr 21 17:08:54 2011 -0700

    maint: fix a race in catalog compilation versioning.
    
    The implementation has a whole pile of time dependencies in our comparisons,
    we had a whole pile of races across the code.
    
    We could try and fix the comparisons to work better, but that is actually
    harder than it sounds thanks to the architecture.
    
    Instead, freeze time for each test, ensuring that we consistently get the
    result expected.

diff --git a/spec/unit/parser/compiler_spec.rb b/spec/unit/parser/compiler_spec.rb
index ced760b..f4cf8b3 100755
--- a/spec/unit/parser/compiler_spec.rb
+++ b/spec/unit/parser/compiler_spec.rb
@@ -40,6 +40,13 @@ describe Puppet::Parser::Compiler do
   end
 
   before :each do
+    # Push me faster, I wanna go back in time!  (Specifically, freeze time
+    # across the test since we have a bunch of version == timestamp code
+    # hidden away in the implementation and we keep losing the race.)
+    # --daniel 2011-04-21
+    now = Time.now
+    Time.stubs(:now).returns(now)
+
     @node = Puppet::Node.new "testnode"
     @known_resource_types = Puppet::Resource::TypeCollection.new "development"
     @compiler = Puppet::Parser::Compiler.new(@node)

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list