summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb9
-rw-r--r--test/ruby/test_process.rb2
-rw-r--r--test/ruby/test_thread.rb5
3 files changed, 7 insertions, 9 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index d71efeb8a2..a1462c53b2 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -3556,8 +3556,7 @@ __END__
end if File::BINARY != 0
def test_race_gets_and_close
- opt = { signal: :ABRT, timeout: 200 }
- assert_separately([], "#{<<-"begin;"}\n#{<<-"end;"}", opt)
+ assert_separately([], "#{<<-"begin;"}\n#{<<-"end;"}")
bug13076 = '[ruby-core:78845] [Bug #13076]'
begin;
10.times do |i|
@@ -3579,9 +3578,9 @@ __END__
w.close
r.close
end
- t.each do |th|
- assert_same(th, th.join(2), bug13076)
- end
+ assert_nothing_raised(IOError, bug13076) {
+ t.each(&:join)
+ }
end
end;
end
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index a0b08dd110..759230f834 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1767,7 +1767,7 @@ class TestProcess < Test::Unit::TestCase
puts Dir.entries("/proc/self/task") - %W[. ..]
end
bug4920 = '[ruby-dev:43873]'
- assert_include(1..2, data.size, bug4920)
+ assert_equal(2, data.size, bug4920)
assert_not_include(data.map(&:to_i), pid)
end
else # darwin
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index 56a7bfb23b..03fd1e3075 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -952,16 +952,15 @@ _eom
def test_thread_timer_and_interrupt
bug5757 = '[ruby-dev:44985]'
pid = nil
- cmd = 'Signal.trap(:INT, "DEFAULT"); pipe=IO.pipe; Thread.start {Thread.pass until Thread.main.stop?; puts; STDOUT.flush}; pipe[0].read'
+ cmd = 'Signal.trap(:INT, "DEFAULT"); r,=IO.pipe; Thread.start {Thread.pass until Thread.main.stop?; puts; STDOUT.flush}; r.read'
opt = {}
opt[:new_pgroup] = true if /mswin|mingw/ =~ RUBY_PLATFORM
s, t, _err = EnvUtil.invoke_ruby(['-e', cmd], "", true, true, opt) do |in_p, out_p, err_p, cpid|
- assert IO.select([out_p], nil, nil, 10), 'subprocess not ready'
out_p.gets
pid = cpid
t0 = Time.now.to_f
Process.kill(:SIGINT, pid)
- Timeout.timeout(10) { Process.wait(pid) }
+ Process.wait(pid)
t1 = Time.now.to_f
[$?, t1 - t0, err_p.read]
end