diff --git a/Gemfile b/Gemfile index e125092c..0fa56b84 100644 --- a/Gemfile +++ b/Gemfile @@ -32,7 +32,7 @@ end gem "rails", github: "rails/rails", tag: "v#{activerecord_version}" group :development do - gem "tracer" + gem "stackprof" # Gems used by the ActiveRecord test suite gem "bcrypt" diff --git a/test/test_helper.rb b/test/test_helper.rb index 290180d3..0f326de6 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -65,7 +65,7 @@ class SpatialModel < ActiveRecord::Base end require 'timeout' -require 'tracer' +require 'stackprof' module TestTimeoutHelper def time_it @@ -73,9 +73,11 @@ def time_it timeout = ENV.fetch("TEST_TIMEOUT", 10).to_i Timeout.timeout(timeout, Timeout::Error, "Test took over #{timeout} seconds to finish") do - Tracer.trace_call do + profile = StackProf.run(mode: :wall, interval: 1000) do yield - end + end + puts + StackProf::Report.new(profile).print_text end ensure self.time = Minitest.clock_time - t0