summaryrefslogtreecommitdiff
path: root/test/testunit/test_parallel.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-13 10:07:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-13 10:07:01 +0000
commitbeb1c085d582b4ac187309560eb871dda5bc3c28 (patch)
tree70a84bbd1128ba33d3101bf9323a6977e6b2c754 /test/testunit/test_parallel.rb
parent42f1ff127249fe4d86c0f7b7ef2b920cbb71601b (diff)
use Timeout.timeout
* time: Object#timeout has been deprecated a long time ago, use Timeout.timeout. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/testunit/test_parallel.rb')
-rw-r--r--test/testunit/test_parallel.rb28
1 files changed, 14 insertions, 14 deletions
diff --git a/test/testunit/test_parallel.rb b/test/testunit/test_parallel.rb
index db3f47e..f068b34 100644
--- a/test/testunit/test_parallel.rb
+++ b/test/testunit/test_parallel.rb
@@ -22,7 +22,7 @@ module TestParallel
@worker_in.puts "quit"
rescue IOError, Errno::EPIPE
end
- timeout(2) do
+ Timeout.timeout(2) do
Process.waitpid(@worker_pid)
end
rescue Timeout::Error
@@ -38,7 +38,7 @@ module TestParallel
end
def test_run
- timeout(10) do
+ Timeout.timeout(10) do
assert_match(/^ready/,@worker_out.gets)
@worker_in.puts "run #{TESTS}/ptest_first.rb test"
assert_match(/^okay/,@worker_out.gets)
@@ -49,7 +49,7 @@ module TestParallel
end
def test_run_multiple_testcase_in_one_file
- timeout(10) do
+ Timeout.timeout(10) do
assert_match(/^ready/,@worker_out.gets)
@worker_in.puts "run #{TESTS}/ptest_second.rb test"
assert_match(/^okay/,@worker_out.gets)
@@ -62,7 +62,7 @@ module TestParallel
end
def test_accept_run_command_multiple_times
- timeout(10) do
+ Timeout.timeout(10) do
assert_match(/^ready/,@worker_out.gets)
@worker_in.puts "run #{TESTS}/ptest_first.rb test"
assert_match(/^okay/,@worker_out.gets)
@@ -80,7 +80,7 @@ module TestParallel
end
def test_p
- timeout(10) do
+ Timeout.timeout(10) do
@worker_in.puts "run #{TESTS}/ptest_first.rb test"
while buf = @worker_out.gets
break if /^p (.+?)$/ =~ buf
@@ -90,7 +90,7 @@ module TestParallel
end
def test_done
- timeout(10) do
+ Timeout.timeout(10) do
@worker_in.puts "run #{TESTS}/ptest_forth.rb test"
7.times { @worker_out.gets }
buf = @worker_out.gets
@@ -115,7 +115,7 @@ module TestParallel
end
def test_quit
- timeout(10) do
+ Timeout.timeout(10) do
@worker_in.puts "quit"
assert_match(/^bye$/m,@worker_out.read)
end
@@ -134,7 +134,7 @@ module TestParallel
def teardown
begin
if @test_pid
- timeout(2) do
+ Timeout.timeout(2) do
Process.waitpid(@test_pid)
end
end
@@ -151,40 +151,40 @@ module TestParallel
"--ruby", @options[:ruby].join(" "),
"-j","0", out: File::NULL, err: o)
o.close
- timeout(10) {
+ Timeout.timeout(10) {
assert_match(/Error: parameter of -j option should be greater than 0/,@test_out.read)
}
end
def test_should_run_all_without_any_leaks
spawn_runner
- buf = timeout(10){@test_out.read}
+ buf = Timeout.timeout(10) {@test_out.read}
assert_match(/^[SFE\.]{9}$/,buf)
end
def test_should_retry_failed_on_workers
spawn_runner
- buf = timeout(10){@test_out.read}
+ buf = Timeout.timeout(10) {@test_out.read}
assert_match(/^Retrying\.+$/,buf)
end
def test_no_retry_option
spawn_runner "--no-retry"
- buf = timeout(10){@test_out.read}
+ buf = Timeout.timeout(10) {@test_out.read}
refute_match(/^Retrying\.+$/,buf)
assert_match(/^ +\d+\) Failure:\nTestD#test_fail_at_worker/,buf)
end
def test_jobs_status
spawn_runner "--jobs-status"
- buf = timeout(10){@test_out.read}
+ buf = Timeout.timeout(10) {@test_out.read}
assert_match(/\d+=ptest_(first|second|third|forth) */,buf)
end
def test_separate
# this test depends to --jobs-status
spawn_runner "--jobs-status", "--separate"
- buf = timeout(10){@test_out.read}
+ buf = Timeout.timeout(10) {@test_out.read}
assert(buf.scan(/(\d+?)[:=]/).flatten.uniq.size > 1)
end
end