1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_thread.rb (TestThreadGroup#test_thread_timer_and_interrupt): suppress interrupt message.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-01-31 05:29:52 +00:00
parent 8dd4353968
commit 487cc8b5ce

View file

@ -689,20 +689,23 @@ class TestThreadGroup < Test::Unit::TestCase
def test_thread_timer_and_interrupt def test_thread_timer_and_interrupt
bug5757 = '[ruby-dev:44985]' bug5757 = '[ruby-dev:44985]'
t0 = Time.now.to_f t0 = Time.now.to_f
pid = spawn(EnvUtil.rubybin, '-e', 'r,=IO.pipe;r.read') pid = nil
sleep 1; cmd = 'r,=IO.pipe; Thread.start {Thread.pass until Thread.main.stop?; puts; STDOUT.flush}; r.read'
s, err = EnvUtil.invoke_ruby(['-e', cmd], "", true, true) do |in_p, out_p, err_p, cpid|
out_p.gets
pid = cpid
Process.kill(:SIGINT, pid) Process.kill(:SIGINT, pid)
Process.wait(pid) Process.wait(pid)
s = $? [$?, err_p.read]
if /mswin|mingw/ =~ RUBY_PLATFORM
# status of signal is not supported on Windows
assert_equal(pid, s.pid)
else
assert_equal([false, true, false],
[s.exited?, s.signaled?, s.stopped?],
"[s.exited?, s.signaled?, s.stopped?]")
end end
t1 = Time.now.to_f t1 = Time.now.to_f
assert_equal(pid, s.pid)
unless /mswin|mingw/ =~ RUBY_PLATFORM
# status of signal is not supported on Windows
assert_equal([false, true, false, Signal.list["INT"]],
[s.exited?, s.signaled?, s.stopped?, s.termsig],
"[s.exited?, s.signaled?, s.stopped?, s.termsig]")
end
assert_in_delta(t1 - t0, 1, 1) assert_in_delta(t1 - t0, 1, 1)
end end
end end