diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-06 07:59:37 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-06 07:59:37 +0000 |
commit | c3e6a7289552eb59f9bb998995d771bdd9c58eba (patch) | |
tree | b654c4faa1f93c8a1c5495c446624a64c43b4786 /bootstraptest | |
parent | 16267c7fee9441c19c7bf13a012fe847a1308d14 (diff) | |
download | ruby-c3e6a7289552eb59f9bb998995d771bdd9c58eba.tar.gz |
btest: resource limit
* bootstraptest/test_thread.rb: rescue resource limitation errors.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_thread.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb index d64f44be49..747b6b88f7 100644 --- a/bootstraptest/test_thread.rb +++ b/bootstraptest/test_thread.rb @@ -25,8 +25,9 @@ rescue ThreadError => e :ok if /can't create Thread/ =~ e.message end } -assert_equal %q{5000}, %q{ - 5000.times{|e| +assert_equal %q{ok}, %q{ +begin + :ok if 5000 == 5000.times{|e| (1..2).map{ Thread.new{ } @@ -34,9 +35,13 @@ assert_equal %q{5000}, %q{ e.join() } } +rescue ThreadError => e + :ok if /can't create Thread/ =~ e.message +end } -assert_equal %q{5000}, %q{ - 5000.times{|e| +assert_equal %q{ok}, %q{ +begin + :ok if 5000 == 5000.times{|e| (1..2).map{ Thread.new{ } @@ -44,6 +49,9 @@ assert_equal %q{5000}, %q{ e.join(1000000000) } } +rescue ThreadError => e + :ok if /can't create Thread/ =~ e.message +end } assert_equal %q{ok}, %q{ begin |