summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2010-07-01 12:01:46 -0700
committerMarkus Roberts <Markus@reality.com>2010-07-01 13:48:03 -0700
commit174e02a2b71fd51ff27f9186526352d79253da26 (patch)
treebd7d78e2eb18dd3394344c4f0b3112b0d52a49ba /test
parent62e3b611e65deab60c615eac553cac9aa7e76d9d (diff)
downloadpuppet-174e02a2b71fd51ff27f9186526352d79253da26.tar.gz
puppet-174e02a2b71fd51ff27f9186526352d79253da26.tar.xz
puppet-174e02a2b71fd51ff27f9186526352d79253da26.zip
[#4090] Change how RunMode instances are created so that an object for each RunMode is only created once instead of every time it's called
Got lots of unpredictable test failures, presumably because a new RunMode was being created every time we accessed the RunMode.
Diffstat (limited to 'test')
-rwxr-xr-xtest/network/authorization.rb2
-rwxr-xr-xtest/network/server/webrick.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/test/network/authorization.rb b/test/network/authorization.rb
index 56c537773..3c1f71e49 100755
--- a/test/network/authorization.rb
+++ b/test/network/authorization.rb
@@ -83,7 +83,7 @@ class TestAuthConfig < Test::Unit::TestCase
assert_logged(:notice, /Denying/, "did not log call")
# Now set our run_mode to master, so calls are allowed
- Puppet::Util::RunMode.any_instance.stubs(:master?).returns true
+ Puppet.run_mode.stubs(:master?).returns true
assert(@obj.authorized?(@request),
"Denied call with no config file and master")
assert_logged(:debug, /Allowing/, "did not log call")
diff --git a/test/network/server/webrick.rb b/test/network/server/webrick.rb
index 99b04817c..e2493b424 100755
--- a/test/network/server/webrick.rb
+++ b/test/network/server/webrick.rb
@@ -93,7 +93,7 @@ class TestWebrickServer < Test::Unit::TestCase
}
pid = fork {
- Puppet::Util::RunMode.any_instance.stubs(:master?).returns true
+ Puppet.run_mode.stubs(:master?).returns true
assert_nothing_raised() {
trap(:INT) { server.shutdown }
server.start