[前][次][番号順一覧][スレッド一覧]

ruby-changes:51740

From: normal <ko1@a...>
Date: Wed, 11 Jul 2018 19:28:10 +0900 (JST)
Subject: [ruby-changes:51740] normal:r63952 (trunk): test/ruby/test_io.rb (test_copy_stream_to_duplex_io): join thread

normal	2018-07-11 19:28:02 +0900 (Wed, 11 Jul 2018)

  New Revision: 63952

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63952

  Log:
    test/ruby/test_io.rb (test_copy_stream_to_duplex_io): join thread
    
    Don't leave runaway threads as it could affect other tests.

  Modified files:
    trunk/test/ruby/test_io.rb
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 63951)
+++ test/ruby/test_io.rb	(revision 63952)
@@ -1188,10 +1188,11 @@ class TestIO < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L1188
 
   def test_copy_stream_to_duplex_io
     result = IO.pipe {|a,w|
-      Thread.start {w.puts "yes"; w.close}
+      th = Thread.start {w.puts "yes"; w.close}
       IO.popen([EnvUtil.rubybin, '-pe$_="#$.:#$_"'], "r+") {|b|
         IO.copy_stream(a, b)
         b.close_write
+        assert_join_threads([th])
         b.read
       }
     }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]