aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_thread.rb
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-04 22:58:08 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-04 22:58:08 +0000
commitc2e83d7fd98438e980c790670608d01e8562c2af (patch)
tree3f4d6a6fbcb203090c5cd20d2f54aa953e49ad6e /test/ruby/test_thread.rb
parentaeb5050234235858d63efa24a074c3feb39571c7 (diff)
downloadruby-c2e83d7fd98438e980c790670608d01e8562c2af.tar.gz
test/ruby/test_thread.rb (test_thread_interrupt_for_killed_thread): conserve resources
Use Thread.pass to let the sub-thread finish. This should avoid running out of memory on resource-constrained systems. (We don't want to use Thread#join to hit the exception) This results in a significant memory usage reduction in this test: make test-all TESTS='../test/ruby/test_thread.rb -v -n test_thread_interrupt_for_killed_thread' Before: 3.46user 2.02system 0:05.29elapsed 103%CPU (0avgtext+0avgdata 88672maxresident)k 0inputs+0outputs (0major+143071minor)pagefaults 0swaps After: 3.40user 1.83system 0:05.20elapsed 100%CPU (0avgtext+0avgdata 9368maxresident)k 0inputs+0outputs (0major+3059minor)pagefaults 0swaps cf. https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-9d6766/ruby-trunk/log/20180803T231706Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_thread.rb')
-rw-r--r--test/ruby/test_thread.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index eb08a22ef7..03fd1e3075 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -1297,6 +1297,7 @@ q.pop
while true
t = Thread.new{sleep 0}
t.raise Interrupt
+ Thread.pass # allow t to finish
end
_end
end