summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-12-10 21:36:39 -0600
committerJames Turnbull <james@lovedthanlost.net>2008-12-12 09:44:42 +1100
commit2385a78a7c455affed26955142a4d4d3ce53c37f (patch)
tree1cf8df7b6812309371e25ddc0287df086e3afc4a /test
parent2961b832de8d0bd6f73dfb6a65a424fd6eb7746a (diff)
downloadpuppet-2385a78a7c455affed26955142a4d4d3ce53c37f.tar.gz
puppet-2385a78a7c455affed26955142a4d4d3ce53c37f.tar.xz
puppet-2385a78a7c455affed26955142a4d4d3ce53c37f.zip
Preparing to fix #1812 - Moving locking code to a module
This moves the locking code out of Puppet::Util into a separate module, to make the code cleaner. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'test')
-rwxr-xr-xtest/util/utiltest.rb33
1 files changed, 0 insertions, 33 deletions
diff --git a/test/util/utiltest.rb b/test/util/utiltest.rb
index 35e1446a1..f838b39fc 100755
--- a/test/util/utiltest.rb
+++ b/test/util/utiltest.rb
@@ -8,39 +8,6 @@ require 'mocha'
class TestPuppetUtil < Test::Unit::TestCase
include PuppetTest
- # 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
- file = tempfile()
- File.open(file, "w") { |f| f.puts "starting" }
-
- value = {:a => :b}
- threads = []
- sync = Sync.new
- 9.times { |a|
- threads << Thread.new {
- 9.times { |b|
- assert_nothing_raised {
- sync.synchronize(Sync::SH) {
- Puppet::Util.readlock(file) { |f|
- f.read
- }
- }
- sleep 0.01
- sync.synchronize(Sync::EX) {
- Puppet::Util.writelock(file) { |f|
- f.puts "%s %s" % [a, b]
- }
- }
- }
- }
- }
- }
- threads.each { |th| th.join }
- end
-
-
def test_withumask
oldmask = File.umask