[ruby-cvs:71278] normal:r64186 (trunk): test/ruby/test_thread.rb (test_thread_interrupt_for_killed_thread): conserve resources

normal at ruby-lang.org normal at ruby-lang.org
Sun Aug 5 07:58:08 JST 2018


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


More information about the ruby-cvs mailing list