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

Handle exception explicitly in TestBignum#test_interrupt_during_to_s

* Otherwise it produces a warning with Thread.report_on_exception=true.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2017-12-12 19:48:32 +00:00
parent 15689ed778
commit 7cb010e3a5

View file

@ -617,12 +617,14 @@ class TestBignum < Test::Unit::TestCase
num = (65536 ** 65536)
thread = Thread.new do
start_flag = true
num.to_s
end_flag = true
assert_raise(RuntimeError) {
num.to_s
end_flag = true
}
end
sleep 0.001 until start_flag
thread.raise
thread.join rescue nil
thread.join
time = Time.now - time
skip "too fast cpu" if end_flag
assert_operator(time, :<, 10)