[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:59 UTC 2009


The following commit has been merged in the master branch:
commit b966ea02a9deeb947bd6153c4cd7c53b1ddff3d8
Author: Luke Kanies <luke at madstop.com>
Date:   Sun Dec 14 22:42:16 2008 -0600

    Modifying the corruption-checking test.
    
    It is now more likely to fail if there's a problem,
    since the yaml should be corrupt, causing a yaml failure.
    
    Also removing the equivalent test from the Storage module.
    
    Signed-off-by: Luke Kanies <luke at madstop.com>

diff --git a/spec/integration/util/file_locking.rb b/spec/integration/util/file_locking.rb
index 171c57a..f8e21ed 100755
--- a/spec/integration/util/file_locking.rb
+++ b/spec/integration/util/file_locking.rb
@@ -11,7 +11,7 @@ describe Puppet::Util::FileLocking do
         file = file.path
         File.open(file, "w") { |f| f.puts "starting" }
 
-        value = {:a => :b}
+        data = {:a => :b, :c => "A string", :d => "another string", :e => %w{an array of strings}}
         threads = []
         sync = Sync.new
         9.times { |a|
@@ -19,13 +19,13 @@ describe Puppet::Util::FileLocking do
                 9.times { |b|
                     sync.synchronize(Sync::SH) {
                         Puppet::Util::FileLocking.readlock(file) { |f|
-                            f.read
+                            YAML.load(f.read)
                         }
                     }
                     sleep 0.01
                     sync.synchronize(Sync::EX) {
                         Puppet::Util::FileLocking.writelock(file) { |f|
-                            f.puts "%s %s" % [a, b]
+                            f.puts YAML.dump(data)
                         }
                     }
                 }
diff --git a/test/util/storage.rb b/test/util/storage.rb
index 5634a94..d3860d6 100755
--- a/test/util/storage.rb
+++ b/test/util/storage.rb
@@ -63,30 +63,6 @@ class TestStorage < Test::Unit::TestCase
         assert_equal(state["name"], hash)
     end
 
-    # we're getting corrupt files, probably because multiple processes
-    # are reading or writing the file at once
-    # so we need to test that
-    def test_multiwrite
-        f = mkfile()
-
-        value = {:a => :b}
-        threads = []
-        9.times { |a|
-            threads << Thread.new {
-                9.times { |b|
-                    assert_nothing_raised {
-                        Puppet::Util::Storage.load
-                        state = Puppet::Util::Storage.cache(f)
-                        value.each { |k,v| state[k] = v }
-                        state[:e] = rand(100)
-                        Puppet::Util::Storage.store
-                    }
-                }
-            }
-        }
-        threads.each { |th| th.join }
-    end
-
     def test_emptyrestore
         Puppet::Util::Storage.load
         Puppet::Util::Storage.store

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list