mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test/ruby/test_thread.rb (test_fork_while_parent_locked): reduce threads
Reduce thread counts unconditionally for some CI systems with low limits.. And Solaris apparently lacks RLIMIT_NPROC, so we can't detect resource limits and scale the test appropriately. [ruby-core:90670] [Bug #15430] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1849288722
commit
db68ccc20d
1 changed files with 2 additions and 3 deletions
|
@ -1246,8 +1246,7 @@ q.pop
|
|||
failures = 0
|
||||
run = true
|
||||
errs = ''
|
||||
nr = 50
|
||||
nr /= 2 if Process.getrlimit(:NPROC)[0] <= 4096 # Bug 15430
|
||||
nr = 25 # reduce if more SIGKILL in tests
|
||||
tmps = nr.times.map { Tempfile.new('Bug.15430.diagnosis') }
|
||||
thrs = nr.times.map do |_i|
|
||||
Thread.new(_i) do |i|
|
||||
|
@ -1276,7 +1275,7 @@ q.pop
|
|||
sleep 0.5
|
||||
run = false
|
||||
thrs.each(&:join)
|
||||
assert_empty errs
|
||||
assert_empty errs, "lower `nr' if SIGKILL because of RLIMIT_NPROC limit"
|
||||
assert_equal 0, failures, '[ruby-core:90312] [Bug #15383]'
|
||||
ensure
|
||||
tmps&.each(&:close!)
|
||||
|
|
Loading…
Reference in a new issue