From 192c181d53d4852f8f6918a4edce776b68051dc5 Mon Sep 17 00:00:00 2001 From: Charlie Savage Date: Mon, 17 Apr 2023 01:33:07 -0700 Subject: [PATCH] Run merge_test.rb on Ruby 3.1 and higher --- test/merge_test.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/test/merge_test.rb b/test/merge_test.rb index e8f26c63..cb1d0770 100644 --- a/test/merge_test.rb +++ b/test/merge_test.rb @@ -2,11 +2,12 @@ # encoding: UTF-8 require File.expand_path('../test_helper', __FILE__) -require_relative './scheduler' -if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.0.0') +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0') + +require_relative './scheduler' -# -- Tests ---- + # -- Tests ---- class MergeTest < TestCase def worker1 sleep(0.5) @@ -47,7 +48,7 @@ def concurrency_multiple_workers end def test_single_worker_unmerged - result = RubyProf::Profile.profile(measure_mode: RubyProf::WALL_TIME, :allow_exceptions => true) { concurrency_single_worker } + result = RubyProf::Profile.profile(measure_mode: RubyProf::WALL_TIME) { concurrency_single_worker } assert_equal(4, result.threads.size) thread = result.threads[0] @@ -76,7 +77,7 @@ def test_single_worker_unmerged end def test_single_worker_merged - result = RubyProf::Profile.profile(measure_mode: RubyProf::WALL_TIME, :allow_exceptions => true) { concurrency_single_worker } + result = RubyProf::Profile.profile(measure_mode: RubyProf::WALL_TIME) { concurrency_single_worker } result.merge! assert_equal(2, result.threads.size) @@ -95,7 +96,7 @@ def test_single_worker_merged end def test_multiple_workers_unmerged - result = RubyProf::Profile.profile(measure_mode: RubyProf::WALL_TIME, :allow_exceptions => true) { concurrency_multiple_workers } + result = RubyProf::Profile.profile(measure_mode: RubyProf::WALL_TIME) { concurrency_multiple_workers } assert_equal(4, result.threads.count) thread = result.threads[0] @@ -124,7 +125,7 @@ def test_multiple_workers_unmerged end def test_multiple_workers_merged - result = RubyProf::Profile.profile(measure_mode: RubyProf::WALL_TIME, :allow_exceptions => true) { concurrency_multiple_workers } + result = RubyProf::Profile.profile(measure_mode: RubyProf::WALL_TIME) { concurrency_multiple_workers } result.merge! assert_equal(2, result.threads.count)