summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/spec_helper.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 51571ddebe9..71985075eba 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -76,6 +76,24 @@ RSpec.configure do |config|
end
end
+ def get_rss
+ output, status = Gitlab::Popen.popen(%W(ps -o rss= -p #{Process.pid}))
+ return 0 unless status.zero?
+
+ output.to_i
+ end
+
+ def get_phantomjs_rss
+ output, status = Gitlab::Popen.popen(%W(ps -o rss= -C phantomjs))
+ return 0 unless status.zero?
+
+ output.to_i
+ end
+
+ config.before(:all) do |group|
+ puts "Working on #{group}: RSS is #{get_rss} #{get_phantomjs_rss}"
+ end
+
config.around(:each, :caching) do |example|
caching_store = Rails.cache
Rails.cache = ActiveSupport::Cache::MemoryStore.new if example.metadata[:caching]