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

ruby-changes:45493

From: nagachika <ko1@a...>
Date: Wed, 8 Feb 2017 01:42:37 +0900 (JST)
Subject: [ruby-changes:45493] nagachika:r57566 (ruby_2_3): merge revision(s) 56892: [Backport #12910]

nagachika	2017-02-08 01:42:32 +0900 (Wed, 08 Feb 2017)

  New Revision: 57566

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

  Log:
    merge revision(s) 56892: [Backport #12910]
    
    test_fileutils.rb: fix deadlock
    
    * test/fileutils/test_fileutils.rb (assert_output_lines): ensure
      that write pipe is closed, not the reader thread to deadlock
      when an exception raised in the given block.
      [ruby-core:78053] [Bug #12910]

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/test/fileutils/test_fileutils.rb
    branches/ruby_2_3/version.h
Index: ruby_2_3/test/fileutils/test_fileutils.rb
===================================================================
--- ruby_2_3/test/fileutils/test_fileutils.rb	(revision 57565)
+++ ruby_2_3/test/fileutils/test_fileutils.rb	(revision 57566)
@@ -18,8 +18,11 @@ class TestFileUtils < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/fileutils/test_fileutils.rb#L18
       fu.instance_variable_set(:@fileutils_output, write)
       th = Thread.new { read.read }
       th2 = Thread.new {
-        yield
-        write.close
+        begin
+          yield
+        ensure
+          write.close
+        end
       }
       th_value, _ = assert_join_threads([th, th2])
       lines = th_value.lines.map {|l| l.chomp }
@@ -216,6 +219,16 @@ class TestFileUtils < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/fileutils/test_fileutils.rb#L219
   # Test Cases
   #
 
+  def test_assert_output_lines
+    assert_raise(MiniTest::Assertion) {
+      Timeout.timeout(0.1) {
+        assert_output_lines([]) {
+          raise "ok"
+        }
+      }
+    }
+  end
+
   def test_pwd
     check_singleton :pwd
 
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 57565)
+++ ruby_2_3/version.h	(revision 57566)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.3"
 #define RUBY_RELEASE_DATE "2017-02-08"
-#define RUBY_PATCHLEVEL 238
+#define RUBY_PATCHLEVEL 239
 
 #define RUBY_RELEASE_YEAR 2017
 #define RUBY_RELEASE_MONTH 2

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r56892


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

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