mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* bootstraptest/test_thread.rb: rescue resource limitation errors.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6983595935
commit
4ab37a13ce
2 changed files with 16 additions and 4 deletions
|
@ -1,3 +1,7 @@
|
|||
Sun Jun 23 15:38:07 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* bootstraptest/test_thread.rb: rescue resource limitation errors.
|
||||
|
||||
Sun Jun 23 08:19:27 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* bignum.c (integer_unpack_single_bdigit): Extracted from
|
||||
|
|
|
@ -10,7 +10,8 @@ assert_equal %q{ok}, %q{
|
|||
:ok
|
||||
}.value
|
||||
}
|
||||
assert_equal %q{20100}, %q{
|
||||
assert_equal %q{ok}, %q{
|
||||
begin
|
||||
v = 0
|
||||
(1..200).map{|i|
|
||||
Thread.new{
|
||||
|
@ -19,7 +20,10 @@ assert_equal %q{20100}, %q{
|
|||
}.each{|t|
|
||||
v += t.value
|
||||
}
|
||||
v
|
||||
v == 20100 ? :ok : v
|
||||
rescue ThreadError => e
|
||||
:ok if e.message =~ "can't create Thread"
|
||||
end
|
||||
}
|
||||
assert_equal %q{5000}, %q{
|
||||
5000.times{|e|
|
||||
|
@ -41,13 +45,17 @@ assert_equal %q{5000}, %q{
|
|||
}
|
||||
}
|
||||
}
|
||||
assert_equal %q{5000}, %q{
|
||||
5000.times{
|
||||
assert_equal %q{ok}, %q{
|
||||
begin
|
||||
:ok if 5000 == 5000.times{
|
||||
t = Thread.new{}
|
||||
while t.alive?
|
||||
Thread.pass
|
||||
end
|
||||
}
|
||||
rescue NoMemoryError
|
||||
:ok
|
||||
end
|
||||
}
|
||||
assert_equal %q{100}, %q{
|
||||
100.times{
|
||||
|
|
Loading…
Reference in a new issue