summaryrefslogtreecommitdiff
path: root/test/testunit
diff options
context:
space:
mode:
Diffstat (limited to 'test/testunit')
-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 db3f47e2a5..f068b344df 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