ruby-changes:51971
From: normal <ko1@a...>
Date: Sun, 5 Aug 2018 07:58:13 +0900 (JST)
Subject: [ruby-changes:51971] normal:r64186 (trunk): test/ruby/test_thread.rb (test_thread_interrupt_for_killed_thread): conserve resources
normal 2018-08-05 07:58:08 +0900 (Sun, 05 Aug 2018) New Revision: 64186 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64186 Log: 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 Modified files: trunk/test/ruby/test_thread.rb Index: test/ruby/test_thread.rb =================================================================== --- test/ruby/test_thread.rb (revision 64185) +++ test/ruby/test_thread.rb (revision 64186) @@ -1297,6 +1297,7 @@ q.pop https://github.com/ruby/ruby/blob/trunk/test/ruby/test_thread.rb#L1297 while true t = Thread.new{sleep 0} t.raise Interrupt + Thread.pass # allow t to finish end _end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/