summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-04-08 13:39:37 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-04-08 15:17:55 -0700
commit78cb48cea0b14eabdfd728c2f9fc183f587faded (patch)
tree6bea2cc578c49dbc30d66c46e8ec5d3c9518b9ab
parent87f4e0a1ce60ddb443a5eda459793c5acb7fce1e (diff)
downloadpuppet-78cb48cea0b14eabdfd728c2f9fc183f587faded.tar.gz
puppet-78cb48cea0b14eabdfd728c2f9fc183f587faded.tar.xz
puppet-78cb48cea0b14eabdfd728c2f9fc183f587faded.zip
maint: disable garbage collector during individual test cases.
This reduced overhead of garbage collection from 50 percent to 20 percent in my test runs, and reduced wall-time to match. This seems to be a reasonable win: we allow the GC to run on demand, but only outside the testing. Memory use went from ~ 300MB to ~550MB between runs, which suggests that we are generating a *lot* of garbage at times, but that we also benefit from cleaning it automatically on a regular basis. Reviewed-By: Matt Robinson <matt@puppetlabs.com>
-rw-r--r--spec/spec_helper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index fc63c6d19..e8ab66611 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -38,6 +38,8 @@ RSpec.configure do |config|
config.mock_with :mocha
config.before :each do
+ GC.disable
+
# these globals are set by Application
$puppet_application_mode = nil
$puppet_application_name = nil
@@ -65,6 +67,8 @@ RSpec.configure do |config|
@logs.clear
Puppet::Util::Log.close_all
+
+ GC.enable
end
end